Cannot change user email from custom database

Hello, we had a user who needed their email changed. I tried to do it in the dashboard, but saw an error. I tried to patch the user instead with the Management API and saw the same error. Finally, I recognized the error as coming from the Get User custom database script, and the problem is the organization ID is not set through the dashboard.
This was my path:

  1. PATCH ~/api/v2/users/:id
  2. Run into error because custom database Get User script expects organization ID
  3. Hard-coded the organization ID into the Get User script (temporarily!)
  4. Ran PATCH again
  5. Get auth0_idp_error 400 Bad Request “The specified new email already exists”

At this point I don’t know what to do. The email does not exist. That’s the main issue. But if someone knows a fix to get organization id included in the Change Email button on the dashboard, that would be nice.
Our workaround is to delete the user through the dashboard and have them login again to hit our initialization code.

Thank you for the response. I can look into these improvements for the organization ID. However, as I said, the main issue is it is incorrectly saying the email exists. It does not.

Hi @kendyl.drayer

Welcome to the Auth0 Community!

Thank you for posting your question. While during the research regarding your question, I found a knowledge article that describes not the same but similar behavior with customDB → "Error! The Specified New Email Already Exists" - Custom DB Connections

Can you check your custom database to see if the email you are trying to change exists in the usernames pool?

Thanks
Dawid

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.