To prevent the creation of accounts with email addresses that already exist

Hi.
Is it possible to prevent the creation of accounts with email addresses that already exist, or to check if a user exists using the provided email address?

Hi Serhii,
Yes, it is possible. If the email address already exists in an Auth0 database that is enabled for the application, it will automatically throw an error and prevent the creation of a new account.

1 Like

Hi @serhii.holub,

Welcome to the Auth0 Community!

I understand that you’re having trouble with users creating multiple profiles with the same email address when logging in with multiple identity providers.

As @Fario_Consulting mentioned, it is possible to check if the user already exists.
For custom database connection with import users mode OOF, Create script is always called when creating a user irrespective of user exists in auth0 or not. The script should return appropriate error in case user exists or call the callback with null. Please make sure you Login script returns unique user_id for that user.

I recommend checking this article, which explains in detail: User Already Exists Error is Shown when Trying to Create a New User, but Cannot Find User with Email in Searches


Please let me know if this helps and if you have any follow-up questions.

Thanks,
Timotei

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