Auth0 Home Blog Docs

Change a user email when using Custom Database



I am using a custom Database and when I tried changing email address, I get an error as “Change_email Script doesn’t exist”. How can we get this accomplished?


You can change your users’ email addresses for custom databases, but you must implement the get_user and change_email scripts. You can find the former in the dashboard under Get User; however, right now the dashboard doesn’t allow you to configure the change_email script. To implement this script, you need to add it to the connection via the management API. You need to use the Update a connection endpoint with the options parameters in this format:

"options": {
    "customScripts": {
      "login": "...",
      "get_user": "...",
      "change_email": "...",

Keep in mind that the options object provided will overwrite whatever was there before, so before doing the PATCH you will have to do a GET to retrieve the full object and amend the options.change_email value accordingly. The change_email script requires this signature:

function changeEmail(oldEmail, newEmail, emailVerified, callback) {
  // change the email and email_verified flags in your internal DB if needed
  // notify if the change was done
  var changeWasSuccessful = true;
  callback(null, changeWasSuccessful);

I understand without the UI this may be a little cumbersome, but you can achieve what you need. We are aware of this limitation and have this feature (configuring via UI) in our backlog, but there’s no ETA on when we’ll implement it.


Thanks Richard.
Received the format from @jmangelo and I can perform that action.