Describes the custom database action script for changing a user’s email.
The Change Email script implements the defined function when a user’s email address or their email address verification status changes. We recommend naming this function 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.
If you manage a custom database connection’s Database Action Scripts through the Auth0 Dashboard, the Change Email script will be automatically deleted upon saving.To ensure that the Change Email script is not removed accidentally, use the Auth0 Management API or Auth0 Deploy CLI when managing the connection.If you manually change a user’s email in your custom database, you must patch the user separately; Auth0 will not automatically detect the change.
If the change email operation succeeded, return the callback function, and pass a null value as the error parameter and a true value as the operationResult parameter:
If the change email operation failed, return the callback function, and pass a null value as the error parameter and a false value as the operationResult parameter: