Can't change email: Error! The specified new email already exists

Our app is using passwordless without external db.

  1. A user has complained that they’ve signed up using a non-gmail account (name@theirdomain.com) and have never received any emails (yes, they’ve looked at the spams folder).
  2. They went ahead and signed up again, this time using a Gmail address. This attempt was successful.
  3. Now I wanted to change the user email to the original, non-gmail account, on the user behalf on Auth0.com. I keep getting The specified new email already exists message even though I can clearly see the email doesn’t exist.

We only have 4 test users and I’m able to change the other user’s email. Please help me resolve this mystery! Thank you.

Hi @nacho ,

Thank you for posting this topic on the Auth0 Community!

1. A user has complained that they’ve signed up using a non-gmail account ([name@theirdomain.com](mailto:name@theirdomain.com)) and have never received any emails (yes, they’ve looked at the spams folder).

I checked your tenant and noticed that it uses the Auth0 build-in Email Provider. This provider is supposed to be used for testing only. As a best practice, we suggest all customers set up their custom email provider. This article has the details.

3. Now I wanted to change the user email to the original, non-gmail account, on the user behalf on [Auth0.com](http://auth0.com/). I keep getting **The specified new email already exists** message even though I can clearly see the email doesn’t exist.

Could you please try the following steps? Hopefully, it helps solve this issue.

  1. call the Search User by Email endpoint to get the user-id
  2. call the Delete a user by id Endpoint to delete the user.
  3. change the user email.

Thanks!

I’m using Auth0 node.js client getUsersByEmail(’ … ') and it can’t find that user.

I can find my other test accounts without any problem.

As a best practice, we suggest all customers set up their custom email provider.

Yes, that’s definitely on our to-do list.

Hi @nacho ,

Thank you for the updates.

Just wondering if you have tried the below steps suggested earlier for the email:name@theirdomain.com. Does that work?

Thanks!

Just wondering if you have tried the below steps suggested earlier for the email:name@theirdomain.com. Does that work?

I did try. As I said, the API call returned no user for that email, so I can’t delete a user if I can’t find it.

Did you mean I need to do with REST API?

Edit: From Auth0 Dashboard log, I can see that Auth0 attempted to send the passwordless login email to name@theirdomain.com (the user is using fastmail btw). I think even though Auth0 is not showing the user on the dashboard nor making it searchable from the API, it has to keep track of this user record somehow to validate the user when they clicks on the link in the email.

Edit: From Auth0 Dashboard log, I can see that Auth0 attempted to send the passwordless login email to [name@theirdomain.com](mailto:name@theirdomain.com) (the user is using fastmail btw). I think even though Auth0 is not showing the user on the dashboard nor making it searchable from the API, it has to keep track of this user record somehow to validate the user when they clicks on the link in the email.

I saw the Failed Exchange Unauthorized error in your tenant log, which does not have email or user details. Not sure if that’s the log you checked.

Could you please DM me a screenshot of the log and the tenant’s name?

Hi @nacho,

Thank you for providing additional context in the DM.

Based on the log, I believe this is how the email was sent.
Go to Authentication → Passwordless → Email → Try, and enter name@theirdomain.com and click Try.

Actually, to create a Passwordless user, please go to the Management API → Create a User endpoint.

Below is my testing body script. Then you can find the user on the Dashboard.
{
email":"testemail@testdomain.com”,
“connection”:“email”
}

To test this issue, I signed up a Fastmail account and received the email from Auth0 dashboard successfully.



I am not sure why the user did not receive the email. Since the logs shows the email was sent successfully, this does not seem related to Auth0.

One workaround is try sending an email from the Passwordless connection to the Fastmail account again, and then go to the log and open the link to sign in. After the user signs in, the email will appear on the Auth0 Dashboard. BTW, the link will expire in 5 mins.

Hope this helps!

This topic was automatically closed after 11 days. New replies are no longer allowed.