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

**URL:** <https://community.auth0.com/t/to-prevent-the-creation-of-accounts-with-email-addresses-that-already-exist/148504>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [October 3, 2024, 2:21pm UTC](https://community.auth0.com/t/to-prevent-the-creation-of-accounts-with-email-addresses-that-already-exist/148504 "2024-10-03T14:21:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![petre.timotei](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@petre.timotei](https://community.auth0.com/u/petre.timotei)\
**Post date:** [October 4, 2024, 2:13pm UTC](https://community.auth0.com/t/to-prevent-the-creation-of-accounts-with-email-addresses-that-already-exist/148504/4 "2024-10-04T14:13:53Z")

</div>

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.

> [@Prevent Sign Up for an an Email that already exist](https://community.auth0.com/t/prevent-sign-up-for-an-an-email-that-already-exist/103469/3):
>
> It _is_ possible to block the signup process when a user tries to sign up with an email address that’s already associated with a profile in your tenant, but that would not be the solution I’d suggest. One reason is because it would lead to a confusing experience for the user and you wouldn’t be able to provide them with feedback on _why_ they’re not able to sign up without revealing that there’s already a profile with that email address, which is a security concern.
> 
> In my opinion account linking is the way to go here, in part because it provides your users the convenience of authenticating via multiple identity providers. I have an account linking rule that meets the qualifications you’re describing and if you send me a DM I’d be happy to reply with the code for that rule.

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](https://community.auth0.com/t/user-already-exists-error-is-shown-when-trying-to-create-a-new-user-but-cannot-find-user-with-email-in-searches/120220)

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

Thanks,  
Timotei

---

_[View the full topic](https://community.auth0.com/t/to-prevent-the-creation-of-accounts-with-email-addresses-that-already-exist/148504)._
