Address PR review on the auth gates
Route the full-name and NDA gates from the request-access flows to their gate pages (deep-linking with the deferred continue URL) instead of a dead-end toast, so signing or naming resumes the original request; the shared gate-to-route mapping now lives in one helper reused by the route boundaries and both request hooks. Fix the NDA page redirecting to home while also redirecting to the continue URL once the signature is sealed, surface consent/accept failures so the sign button isn't silently inert, and build the request-all continue URL before clearing its marker. On the backend, return success from updateFullName when the identity has no organization profile instead of dereferencing a nil profile, which crashed external trust-center visitors completing the full-name gate. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -161,10 +161,15 @@ func (r *mutationResolver) UpdateFullName(ctx context.Context, input types.Updat
|
||||
|
||||
profile, err := r.iam.OrganizationService.GetProfileForIdentityAndOrganization(ctx, identity.ID, compliancePage.OrganizationID)
|
||||
if err != nil {
|
||||
if _, ok := errors.AsType[*iam.ErrProfileNotFound](err); !ok {
|
||||
r.logger.ErrorCtx(ctx, "cannot get profile", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
// External trust-center visitors have no organization profile; updating
|
||||
// the identity's full name above is all that is needed for them.
|
||||
if _, ok := errors.AsType[*iam.ErrProfileNotFound](err); ok {
|
||||
return &types.UpdateFullNamePayload{Success: true}, nil
|
||||
}
|
||||
|
||||
r.logger.ErrorCtx(ctx, "cannot get profile", log.Error(err))
|
||||
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
if profile.Source == coredata.ProfileSourceManual {
|
||||
|
||||
Reference in New Issue
Block a user