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 accepts four parameters and returns a callback
function:
Parameter | Type | Description |
---|---|---|
email | String | User’s current email address. |
newEmail | String | Value to be set as user’s new email address in external database. |
verified | Boolean | Email verification status of the new email address. |
callback | Function | Used to pass error data through the pipeline. |
changeEmail
function:
callback
function accepts two parameters and returns a function.
Parameter | Type | Required | Description |
---|---|---|---|
error | Object | Required | Contains error data. |
operationResult | Boolean | Optional | Indicates the result of the change email operation. |
callback
function, and pass a null
value as the error
parameter and a true
value as the operationResult
parameter:
callback
function, and pass a null
value as the error
parameter and a false
value as the operationResult
parameter:
callback
function, and pass relevant error information as the error
parameter: