# Last\_login updated even if a user fails to login "Type Failed Login" due to Auth0 rule failure

**URL:** <https://community.auth0.com/t/last-login-updated-even-if-a-user-fails-to-login-type-failed-login-due-to-auth0-rule-failure/41123>\
**Category:** Get Help\
**Created:** [April 15, 2020, 4:20pm UTC](https://community.auth0.com/t/last-login-updated-even-if-a-user-fails-to-login-type-failed-login-due-to-auth0-rule-failure/41123 "2020-04-15T16:20:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris.Ward](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.ward/32/14311_2.png) [@Chris.Ward](https://community.auth0.com/u/Chris.Ward)\
**Post date:** [April 15, 2020, 4:20pm UTC](https://community.auth0.com/t/last-login-updated-even-if-a-user-fails-to-login-type-failed-login-due-to-auth0-rule-failure/41123/1 "2020-04-15T16:20:57Z")

</div>

Hi all and thank you for your time in advance!

So I’ve seen a situation come up where an Auth0 user attempts to sign in , and they fail to due to an Auth0 rule.

Rule Snippet →

```auto
    if (user.app_metadata.deactivated === true) {
        return callback(new UnauthorizedError("User has been deactivated and is unable to login."));

```

The Auth0 History for the user shows

```auto
Type: Failed Login
Description: User has been deactivated and is unable to login.

```

however the “last\_login” date for the user is updated to this date, and i would expect that not to happen.

Is this a known bug? i saw a closed ticket about this with no public resolution [Last\_login updated even if a user is blocked (on profile)](http://community.auth0.com/t/last-login-updated-even-if-a-user-is-blocked-on-profile/12558)

that feels very similar.

Thank you for your time,

Chris Ward

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 15, 2020, 8:01pm UTC](https://community.auth0.com/t/last-login-updated-even-if-a-user-fails-to-login-type-failed-login-due-to-auth0-rule-failure/41123/3 "2020-04-15T20:01:07Z")

</div>

Hi @Chris.Ward,

This is likely because rules are run _after successful authentication_. If this is something you would like to give the product team feedback on, that can be done [here](https://auth0.com/feedback).

Thank you!  
Dan

---

<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:** [April 30, 2020, 8:01pm UTC](https://community.auth0.com/t/last-login-updated-even-if-a-user-fails-to-login-type-failed-login-due-to-auth0-rule-failure/41123/4 "2020-04-30T20:01:12Z")

</div>

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