# Routing user based on existence in Auth0 upon Login

**URL:** <https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [May 2, 2024, 7:38am UTC](https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249 "2024-05-02T07:38:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aditya.b.gautam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aditya.b.gautam/32/60209_2.png) [@aditya.b.gautam](https://community.auth0.com/u/aditya.b.gautam)\
**Post date:** [May 2, 2024, 7:38am UTC](https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249/1 "2024-05-02T07:38:33Z")

</div>

Hi Experts,

I have a scenario where as part of Login step we would like to check user’s existence into Auth0 first and if user is present, he should be presented with the _Login-page1_ ( **Username** & **Password** ), and if not present (needs to be migrated) in Auth0 then he should be presented with a Auth0 _Login-page2_ **USERNAME** + **GROUP** + **PASSWORD** where as part of Lazy Migration user will be authenticated from External DB and pulled into Auth0. After being imported into Auth0, going ahead he always supposed to be redirected to Login-Page1 only.

Is it this something feasible from Auth0 perspective?

Pls help/suggest.

Thanks,  
Aditya

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [May 2, 2024, 2:57pm UTC](https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249/4 "2024-05-02T14:57:57Z")

</div>

Hi @aditya.b.gautam , welcom to our community! 👋

> [@aditya.b.gautam](#):
>
> check user’s existence into Auth0

The discovery part would need to be achieved on your side, on your application level, which would send the [/authorize](https://auth0.com/docs/api/authentication#social) request to Auth0 with a relevant connection (database) name. The reason for that is:  
-to do lazy migration, you would have to use our [Universal Login](https://auth0.com/docs/authenticate/login/auth0-universal-login), and  
-Universal login can show up to the user with only one database login prompts (the first one assigned to the application or the one indicated with the` /authorize` request via the `connection` name).

The topic has been discussed [here](https://community.auth0.com/t/custom-database-login-script-not-getting-called/132330/5), so please take a look and let us know if any questions may arise from that.

Thanks,  
Marcelina

---

<div class="post-metadata">

**Author:** ![aditya.b.gautam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aditya.b.gautam/32/60209_2.png) [@aditya.b.gautam](https://community.auth0.com/u/aditya.b.gautam)\
**Post date:** [May 9, 2024, 1:46pm UTC](https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249/5 "2024-05-09T13:46:40Z")

</div>

Hi @marcelina.barycka ,

AFAIU, Discovery (HRD) won’t check for user existence at Auth0 and in my case I want user to searched first at Auth0, if found show them LoginPage\_1 else LoginPage\_2, where this login page must be Auth0 managed (Classic or Universal, any).

Thanks,  
Aditya

---

<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:** [May 23, 2024, 1:47pm UTC](https://community.auth0.com/t/routing-user-based-on-existence-in-auth0-upon-login/133249/6 "2024-05-23T13:47:37Z")

</div>

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