# Identify the user is logged in or registered

**URL:** <https://community.auth0.com/t/identify-the-user-is-logged-in-or-registered/110545>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [July 4, 2023, 1:54pm UTC](https://community.auth0.com/t/identify-the-user-is-logged-in-or-registered/110545 "2023-07-04T13:54:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmdanish](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mmdanish/32/47292_2.png) [@mmdanish](https://community.auth0.com/u/mmdanish)\
**Post date:** [July 4, 2023, 1:54pm UTC](https://community.auth0.com/t/identify-the-user-is-logged-in-or-registered/110545/1 "2023-07-04T13:54:01Z")

</div>

i have some question about how to find the user either the user is logged in or registered is there any way to differentiate .

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 5, 2023, 9:20am UTC](https://community.auth0.com/t/identify-the-user-is-logged-in-or-registered/110545/2 "2023-07-05T09:20:13Z")

</div>

Hey there!

Here’s the way to do it:

> [@Distinguish between a sign up and a login](https://community.auth0.com/t/distinguish-between-a-sign-up-and-a-login/27924):
>
> Hey guys; When a user registers I would like to create a record in my own database, so I need to be able distinguish between login and sign up. Perhaps I could change the post login callback URL. For example I could add the following to the allowed callback URLS [https://localhost:3000/callback](https://localhost:3000/callback), [https://localhost:3000/register](https://localhost:3000/register) And then add rule with a code snippet like this: if (context.stats.loginsCount === 1) { context.redirect = { url: "https://localhost:3000/register" };…

but you should keep in mind that at some point you will need to convert the rule to action as we are [deprecating rules](https://community.auth0.com/t/rules-and-hooks-nearing-end-of-life/107038) next year.

---

<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:** [July 19, 2023, 9:20am UTC](https://community.auth0.com/t/identify-the-user-is-logged-in-or-registered/110545/3 "2023-07-19T09:20:38Z")

</div>

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