changeEmail.
The script is only used in a legacy authentication scenario, and is required if you want to update a user’s email address (and/or email address verification status) in Auth0 and your external database in the same operation.
The Change Email script is not configurable through the . To manage this script, you must use the Auth0 Create a connection or Update a connection endpoint, or the Auth0 Deploy CLI.
ChangeEmail function
ThechangeEmail function should:
- Update the user’s email address in the external database.
- Return an error if the operation failed or an error occurred.
Definition
ThechangeEmail function accepts four parameters and returns a callback function:
This is a pseudo-JavaScript example of how you could implement the
changeEmail function:
Callback function
Thecallback function accepts two parameters and returns a function.
Definition
Return a success
If the change email operation succeeded, return thecallback function, and pass a null value as the error parameter and a true value as the operationResult parameter:
Return a failure
If the change email operation failed, return thecallback function, and pass a null value as the error parameter and a false value as the operationResult parameter:
Return an error
If an error occurred, return thecallback function, and pass relevant error information as the error parameter: