# Different redirect for users who have logged in with previous accounts vs users who have just signed up

**URL:** <https://community.auth0.com/t/different-redirect-for-users-who-have-logged-in-with-previous-accounts-vs-users-who-have-just-signed-up/95674>\
**Category:** Get Help\
**Tags:** user-password-management, user-management\
**Created:** [December 5, 2022, 12:45pm UTC](https://community.auth0.com/t/different-redirect-for-users-who-have-logged-in-with-previous-accounts-vs-users-who-have-just-signed-up/95674 "2022-12-05T12:45:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linustalacko](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/linustalacko/32/41720_2.png) [@linustalacko](https://community.auth0.com/u/linustalacko)\
**Post date:** [December 5, 2022, 12:45pm UTC](https://community.auth0.com/t/different-redirect-for-users-who-have-logged-in-with-previous-accounts-vs-users-who-have-just-signed-up/95674/1 "2022-12-05T12:45:10Z")

</div>

Hey!

I am having trouble redirecting users who have just signed up compared to those who have logged in with previously existing accounts. First of all, is this even possible? and if so, it would be great if i could get any advice!

---

<div class="post-metadata">

**Author:** ![david\_wisecarver](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david_wisecarver/32/37472_2.png) [@david\_wisecarver](https://community.auth0.com/u/david_wisecarver)\
**Post date:** [December 7, 2022, 12:38am UTC](https://community.auth0.com/t/different-redirect-for-users-who-have-logged-in-with-previous-accounts-vs-users-who-have-just-signed-up/95674/2 "2022-12-07T00:38:45Z")

</div>

Hi @linustalacko,

We expose the user’s login count in post-login actions/rules, which you can use to detect the user’s first time logging in. This is available as `event.stats.logins_count` in post-login actions or `context.stats.loginsCount` in rules. You can use this to add a custom claim to the user’s id token which your application receives after the user logs in. Then you can write custom redirect logic in your application based on this custom claim.

Here is an example of adding a custom claim in a post-login action: [Login Flow](https://auth0.com/docs/actions/triggers/post-login#add-user-roles-to-tokens)  
And our guide for custom claims in rules: [Sample Use Cases: Scopes and Claims](https://auth0.com/docs/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token)

Hope this helps!

Thanks,  
Dave

---

<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:** [January 10, 2023, 12:13pm UTC](https://community.auth0.com/t/different-redirect-for-users-who-have-logged-in-with-previous-accounts-vs-users-who-have-just-signed-up/95674/3 "2023-01-10T12:13:28Z")

</div>

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