Remove full name input from nda page
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -751,38 +751,6 @@ func (s AuthService) OpenSessionWithMagicLink(ctx context.Context, tokenString s
|
||||
return identity, session, payload.Data.Continue, nil
|
||||
}
|
||||
|
||||
func (s *AuthService) UpdateIdentity(ctx context.Context, identityID gid.GID, fullName string) (*coredata.Identity, error) {
|
||||
identity := &coredata.Identity{}
|
||||
|
||||
err := s.pg.WithTx(
|
||||
ctx,
|
||||
func(tx pg.Conn) error {
|
||||
if err := identity.LoadByID(ctx, tx, identityID); err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return NewIdentityNotFoundError(identityID)
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot load identity: %w", err)
|
||||
}
|
||||
|
||||
identity.FullName = fullName
|
||||
identity.UpdatedAt = time.Now()
|
||||
|
||||
if err := identity.Update(ctx, tx); err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return NewIdentityNotFoundError(identityID)
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot update identity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
return identity, err
|
||||
}
|
||||
|
||||
func HashToken(token string) []byte {
|
||||
hash := sha256.Sum256([]byte(token))
|
||||
return hash[:]
|
||||
|
||||
@@ -801,7 +801,6 @@ type ElectronicSignature implements Node {
|
||||
|
||||
input AcceptElectronicSignatureInput {
|
||||
signatureId: ID!
|
||||
fullName: String!
|
||||
}
|
||||
|
||||
type AcceptElectronicSignaturePayload {
|
||||
|
||||
@@ -2223,7 +2223,6 @@ type ElectronicSignature implements Node {
|
||||
|
||||
input AcceptElectronicSignatureInput {
|
||||
signatureId: ID!
|
||||
fullName: String!
|
||||
}
|
||||
|
||||
type AcceptElectronicSignaturePayload {
|
||||
@@ -9294,7 +9293,7 @@ func (ec *executionContext) unmarshalInputAcceptElectronicSignatureInput(ctx con
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"signatureId", "fullName"}
|
||||
fieldsInOrder := [...]string{"signatureId"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -9308,13 +9307,6 @@ func (ec *executionContext) unmarshalInputAcceptElectronicSignatureInput(ctx con
|
||||
return it, err
|
||||
}
|
||||
it.SignatureID = data
|
||||
case "fullName":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullName"))
|
||||
data, err := ec.unmarshalNString2string(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.FullName = data
|
||||
}
|
||||
}
|
||||
return it, nil
|
||||
|
||||
@@ -18,7 +18,6 @@ type Node interface {
|
||||
|
||||
type AcceptElectronicSignatureInput struct {
|
||||
SignatureID gid.GID `json:"signatureId"`
|
||||
FullName string `json:"fullName"`
|
||||
}
|
||||
|
||||
type AcceptElectronicSignaturePayload struct {
|
||||
|
||||
@@ -597,16 +597,6 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||
)
|
||||
|
||||
if _, err := r.iam.AuthService.UpdateIdentity(ctx, identity.ID, input.FullName); err != nil {
|
||||
var errNotFound *iam.ErrIdentityNotFound
|
||||
if errors.As(err, &errNotFound) {
|
||||
return nil, gqlutils.NotFound(ctx, err)
|
||||
}
|
||||
|
||||
r.logger.ErrorCtx(ctx, "cannot update identity", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
signerIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||
if signerIP == "" {
|
||||
signerIP = httpReq.RemoteAddr
|
||||
@@ -616,7 +606,7 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
||||
ctx,
|
||||
&esign.AcceptSignatureRequest{
|
||||
SignatureID: input.SignatureID,
|
||||
SignerFullName: input.FullName,
|
||||
SignerFullName: identity.FullName,
|
||||
SignerEmail: identity.EmailAddress,
|
||||
SignerIPAddr: signerIP,
|
||||
SignerUA: httpReq.UserAgent(),
|
||||
|
||||
Reference in New Issue
Block a user