# How to know if user was just sign in or sign up? (using loginsCount is a wrong way)

**URL:** <https://community.auth0.com/t/how-to-know-if-user-was-just-sign-in-or-sign-up-using-loginscount-is-a-wrong-way/111221>\
**Category:** Get Help\
**Tags:** signup-prompt-new-experience, login-experience\
**Created:** [July 13, 2023, 4:39pm UTC](https://community.auth0.com/t/how-to-know-if-user-was-just-sign-in-or-sign-up-using-loginscount-is-a-wrong-way/111221 "2023-07-13T16:39:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![traitimtrongvang](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@traitimtrongvang](https://community.auth0.com/u/traitimtrongvang)\
**Post date:** [July 13, 2023, 4:39pm UTC](https://community.auth0.com/t/how-to-know-if-user-was-just-sign-in-or-sign-up-using-loginscount-is-a-wrong-way/111221/1 "2023-07-13T16:39:34Z")

</div>

How to know if user was just sign in or sign up?

My case is, when user sign in, I redirect them to page A, but when user sign up, I redirect them to page B (this page is to init their profile)

Well, some people say that I should use ‘loginCount’, if it equal to 1, mean user was just sign up then the app redirect user to page B.

The problem is, suppose user was signed up, and they had complete all steps from page B, now they are in page A as expect, but when user reload the page, the app redirect user to the page B, and they stuck in this page, because the ‘loginCount’ is still equal to 1, it only add up when the user actually sign in using email and password.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 13, 2023, 9:54pm UTC](https://community.auth0.com/t/how-to-know-if-user-was-just-sign-in-or-sign-up-using-loginscount-is-a-wrong-way/111221/3 "2023-07-13T21:54:14Z")

</div>

Hey there @traitimtrongvang welcome to the community!

> [@traitimtrongvang](#):
>
> The problem is, suppose user was signed up, and they had complete all steps from page B, now they are in page A as expect, but when user reload the page, the app redirect user to the page B, and they stuck in this page, because the ‘loginCount’ is still equal to 1, it only add up when the user actually sign in using email and password.

Interesting use case! I might recommend looking into using user and or app [metadata](https://auth0.com/docs/manage-users/user-accounts/metadata) instead of relying on `login_count` - This is typically managed through Actions:

> **[Manage User Metadata with the post-login Action Trigger](https://auth0.com/docs/manage-users/user-accounts/metadata/manage-user-metadata)**
>
> Learn how to use the post-login Action trigger to modify user\_metadata and app\_metadata as part of a user’s login flow.

My thinking is that you can set some sort of flag on the user profile when they signup, and then [update it](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) once they confirm their profile using the Management API.

I’m not entirely sure this addresses your specific use case, but hope it helps give you an idea as to what may be possible!

---

<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 27, 2023, 9:54pm UTC](https://community.auth0.com/t/how-to-know-if-user-was-just-sign-in-or-sign-up-using-loginscount-is-a-wrong-way/111221/4 "2023-07-27T21:54:36Z")

</div>

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