# How to prevent user-password when user is already registered via passwordless

**URL:** <https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [February 28, 2023, 2:25pm UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471 "2023-02-28T14:25:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bencip19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bencip19/32/45002_2.png) [@bencip19](https://community.auth0.com/u/bencip19)\
**Post date:** [February 28, 2023, 2:25pm UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471/1 "2023-02-28T14:25:02Z")

</div>

Scenario:

1. User logs in via oauth / passwordless.
2. Another user creates an account, using the same password

Right now, this allows the second user to log into the system as the first user, as (a) we don’t require email verification before login and (b) our auth0 config treats these two as different users (we do not on our backend side).

Rather than requiring a user to verify their email before they can log in, I’d rather prevent re-registeration via email/password when there’s a passwordless account.

Is there a canned hook for doing this? And is this a fairly standard thing to do? I’m a bit surprised by the defaults here.

---

<div class="post-metadata">

**Author:** ![james.merrigan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.merrigan/32/44373_2.png) [@james.merrigan](https://community.auth0.com/u/james.merrigan)\
**Post date:** [March 3, 2023, 9:37am UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471/3 "2023-03-03T09:37:55Z")

</div>

Hi @bencip19 👋

Welcome to the Community!

You can leverage the [Management API within Auth0 Pre-Registration Action](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) to check if the user with the same email already exists in another connection, and if so, block the user from registering.

I would recommend reading over [this post](https://community.auth0.com/t/how-to-disallow-a-user-to-with-a-same-email-access-another-mode-of-authentication/97030/2) that details how you can do this, along with some sample code to point you in the right direction.

I hope this helps. Let me know how you get on!

---

<div class="post-metadata">

**Author:** ![bencip19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bencip19/32/45002_2.png) [@bencip19](https://community.auth0.com/u/bencip19)\
**Post date:** [March 3, 2023, 3:14pm UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471/4 "2023-03-03T15:14:01Z")

</div>

Hey @james.merrigan !

Ya, I saw those examples and actually implemented one. But it struck me as odd that I would have to do that, and wondered why the out-of-the-box behavior is permissive. i.e. I feel like I’m missing something on why this isn’t the default - which I wanted to check before implementing.

---

<div class="post-metadata">

**Author:** ![cholayt0](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cholayt0/32/45131_2.png) [@cholayt0](https://community.auth0.com/u/cholayt0)\
**Post date:** [March 4, 2023, 7:13pm UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471/5 "2023-03-04T19:13:10Z")

</div>

> [@james.merrigan](#):
>
> Welcome to the Community!
> 
> You can leverage the [Management API within Auth0 Pre-Registration Action](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) to check if the user with the same email already exists in another connection, and if so, block the user from registering.
> 
> I would recommend reading over [this post](https://alightmotionapps.com/alight-motion-pro-apk/) that details how you can do this, along with some sample code to point you in the right direction.
> 
> I hope this helps. Let me know how you get on!

Thanks for providing such a great solution to the problem, very satisfied.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 18, 2023, 7:13pm UTC](https://community.auth0.com/t/how-to-prevent-user-password-when-user-is-already-registered-via-passwordless/101471/6 "2023-03-18T19:13:47Z")

</div>

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