# How to differentiate SignIn from SingUp in React Native?

**URL:** <https://community.auth0.com/t/how-to-differentiate-signin-from-singup-in-react-native/117264>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [September 27, 2023, 2:48pm UTC](https://community.auth0.com/t/how-to-differentiate-signin-from-singup-in-react-native/117264 "2023-09-27T14:48:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![homerogazze1015](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/homerogazze1015/32/48943_2.png) [@homerogazze1015](https://community.auth0.com/u/homerogazze1015)\
**Post date:** [September 27, 2023, 2:48pm UTC](https://community.auth0.com/t/how-to-differentiate-signin-from-singup-in-react-native/117264/1 "2023-09-27T14:48:31Z")

</div>

Well, my situation is as follows. I am trying to implement auth0 authentication plus an in-app form of my own with data that auth0 does not provide. However, I need to be able to differentiate between a SignIn and a SignUp in order to be able to route the user to the corresponding screen. At the moment I haven’t found any way to do it…

---

<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:** [September 27, 2023, 10:56pm UTC](https://community.auth0.com/t/how-to-differentiate-signin-from-singup-in-react-native/117264/3 "2023-09-27T22:56:21Z")

</div>

Hello @homerogazze1015 welcome to the community!

> [@homerogazze1015](#):
>
> However, I need to be able to differentiate between a SignIn and a SignUp in order to be able to route the user to the corresponding screen.

One option is to use an action to add a custom claim to a user’s ID token indicating that it is their first time logging in, and thus have just signed up. After adding the custom claim to a user’s ID token, you can access the claim in the [useAuth0()](https://auth0.github.io/react-native-auth0/functions/useAuth0.html) hook.

Action code to add the custom claim for example:

```auto
exports.onExecutePostLogin = async (event, api) => {

  const namespace = 'https://yournamespace.com/'; // replace with your namespace
  let isNewUser = event.stats.logins_count === 1;
  
  api.idToken.setCustomClaim(namespace + 'isNewUser', isNewUser);
}

```

---

<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:** [October 11, 2023, 10:56pm UTC](https://community.auth0.com/t/how-to-differentiate-signin-from-singup-in-react-native/117264/4 "2023-10-11T22:56:51Z")

</div>

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