You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements the `after-user-created` hook which runs whenever a
new user has been successfully created.
Summary:
- Add `triggerAfterUserCreated` method to the `*API` object in
`internal/api/hooks.go`
- Update user creation paths to call `triggerAfterUserCreated` after a
new user is persisted:
- internal/api/anonymous.go
- internal/api/external.go
- internal/api/invite.go
- internal/api/mail.go
- internal/api/signup.go
- internal/api/samlacs.go
- internal/api/token_oidc.go
- internal/api/web3.go
- Extend `createAccountFromExternalIdentity` to return an
`AccountLinkingDecision` to detect newly created accounts
- Add full end-to-end verification of the new hook in
`internal/api/e2e_test.go`
Co-authored-by: Chris Stockton <[email protected]>
returnnil, apierrors.NewInternalServerError("Multiple accounts with the same email address in the same linking domain detected: %v", decision.LinkingDomain)
389
+
return0, nil, apierrors.NewInternalServerError("Multiple accounts with the same email address in the same linking domain detected: %v", decision.LinkingDomain)
returnnil, storage.NewCommitWithError(apierrors.NewUnprocessableEntityError(apierrors.ErrorCodeProviderEmailNeedsVerification, fmt.Sprintf("Unverified email with %v. A confirmation email has been sent to your %v email", providerType, providerType)))
430
+
return0, nil, storage.NewCommitWithError(apierrors.NewUnprocessableEntityError(apierrors.ErrorCodeProviderEmailNeedsVerification, fmt.Sprintf("Unverified email with %v. A confirmation email has been sent to your %v email", providerType, providerType)))
425
431
}
426
432
427
-
returnnil, storage.NewCommitWithError(apierrors.NewUnprocessableEntityError(apierrors.ErrorCodeProviderEmailNeedsVerification, fmt.Sprintf("Unverified email with %v. Verify the email with %v in order to sign in", providerType, providerType)))
433
+
return0, nil, storage.NewCommitWithError(apierrors.NewUnprocessableEntityError(apierrors.ErrorCodeProviderEmailNeedsVerification, fmt.Sprintf("Unverified email with %v. Verify the email with %v in order to sign in", providerType, providerType)))
0 commit comments