# How to distinguish first login after sign up

**URL:** <https://community.auth0.com/t/how-to-distinguish-first-login-after-sign-up/94885>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [November 22, 2022, 4:14am UTC](https://community.auth0.com/t/how-to-distinguish-first-login-after-sign-up/94885 "2022-11-22T04:14:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [November 22, 2022, 8:51pm UTC](https://community.auth0.com/t/how-to-distinguish-first-login-after-sign-up/94885/4 "2022-11-22T20:51:41Z")

</div>

Post-Login Actions do occur for silent authentication requests.

A reliable solution would be to see if `stripe_customer_id` already exists in the user app\_metadata object, and skip the action for the user if it does.

However, if you need to rely on first logins only in the Post-Login Action flow instead, something like below might help

```auto
// check if user has more than one login, or if this is a refresh token rotation, or a silent auth request
const not_first_login = event.stats.logins_count > 1 ||
                        event.transaction?.protocol === 'oauth2-refresh-token' ||
                        event.request.query?.prompt === 'none';
if (not_first_login) {
  console.log(`Skipping event for user ${event.user.user_id}`);
  return;
}

```

This will skip the action for the user if the user’s login\_count is greater than one, or if the Post-Login Action was triggered by refresh token rotations & silent authentication requests.

Hope this helps!

---

_[View the full topic](https://community.auth0.com/t/how-to-distinguish-first-login-after-sign-up/94885)._
