Getting "customer_already_exists" error when making new DB user for social user

For my app, I want everyone to have a standard Auth0 database user. To facilitate this, I would like to create a DB user account when they sign in with a social account, using the same email address, and then link them.

I am getting a “customer_already_exists” error when I try and register a DB user, when the only user present with that email is the social (google) user. As far as I know, this shouldn’t be a problem, since I had a social user with the same email working before while testing.

I did check via an API to managementClient.usersByEmail.getByEmail() call that runs right before the new DB user create, that the only user with that email is the social account. The connection I am trying to create a user on is “Username-Password-Authentication”.

What is going on here? Can I not make a DB user when there’s a social user with that email?

1 Like

Hi @hh-info

Thank you for reaching out to us!

While this does not seem to be a standard error message, I suspect that you might be handling the user Account Linking via Actions which would error with the "customer_already_exists " message under certain conditions. If this is the case, I would recommend going through our documentation above and double-check the Action, in case anything could be misconfigured.

I have checked on my end, confirming that you can indeed still have 2 users with the same email address, one from a Social Connection, the other one from a Username-Password DB. The behaviour that you are seeing is likely caused by potentially an Action in your tenant. As this has previously worked in the past with other users, I encourage your to review for any changes made to the Actions and authentication flow in general.

Allow me to share some additional resources that should prove useful:

Let us know if you were able to identify the issue and configure Account Linking!

Best regards,
Gerald

1 Like

Ah, I checked my Actions and noticed that I am actually sending a “customer_already_exists” error when the customer already exists in my external system, which is probably what’s happening when I’m using the same email to test the account linking integration. I’ll start there, thanks!

1 Like