# How to use post login action to force reset password with universal login?

**URL:** <https://community.auth0.com/t/how-to-use-post-login-action-to-force-reset-password-with-universal-login/62968>\
**Category:** Get Help\
**Created:** [May 18, 2021, 3:04am UTC](https://community.auth0.com/t/how-to-use-post-login-action-to-force-reset-password-with-universal-login/62968 "2021-05-18T03:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandeep.s.gulati](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mandeep.s.gulati/32/28866_2.png) [@mandeep.s.gulati](https://community.auth0.com/u/mandeep.s.gulati)\
**Post date:** [May 18, 2021, 3:04am UTC](https://community.auth0.com/t/how-to-use-post-login-action-to-force-reset-password-with-universal-login/62968/1 "2021-05-18T03:04:12Z")

</div>

I am using universal login with a VueJS single page application. We need to force the users to reset their password the first time they login. I can see that we have a field `last_password_reset` which is set to true once a user resets their password.

I can also see that in post-login actions, we can deny login by using `api.access.deny` method. So, I wrote a very basic custom action like this

```
exports.onExecutePostLogin = async (event, api) => {
  if (event.user.last_password_reset) {
    return;
  }
  api.access.deny(`You need to reset your password. Click on the "Don't remember your password" link below to receive a password reset email`);
};

```

What I want to achieve is to show a flash message on the universal login lock.js screen when the access is denied. However, what happens right now is that I am redirected to my Vue js application with the error and error description as query parameters. Is there any way I can stop the lock.js page from redirecting the user to my application when access is denied with the post-login action? Or is there any better way of achieving what I am trying to achieve?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 18, 2021, 4:06pm UTC](https://community.auth0.com/t/how-to-use-post-login-action-to-force-reset-password-with-universal-login/62968/3 "2021-05-18T16:06:17Z")

</div>

Hi @mandeep.s.gulati,

Welcome to the Community!

Everything looks great with your action, and this is the recommended approach. Unfortunately, when authorization errors occur in roles or actions, the application must display the error to the user, not the universal login page. You can find more information in this FAQ (the FAQ refers to rules, but the same is true in post-login actions):  
[https://community.auth0.com/t/can-i-show-errors-raised-in-rules-in-the-login-page/51143](https://community.auth0.com/t/can-i-show-errors-raised-in-rules-in-the-login-page/51143)

---

<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:** [June 2, 2021, 4:07pm UTC](https://community.auth0.com/t/how-to-use-post-login-action-to-force-reset-password-with-universal-login/62968/4 "2021-06-02T16:07:03Z")

</div>

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