# Action to deny login with message

**URL:** <https://community.auth0.com/t/action-to-deny-login-with-message/91711>\
**Category:** Get Help\
**Created:** [October 3, 2022, 4:03pm UTC](https://community.auth0.com/t/action-to-deny-login-with-message/91711 "2022-10-03T16:03:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michaelh/32/40376_2.png) [@michaelh](https://community.auth0.com/u/michaelh)\
**Post date:** [October 3, 2022, 4:03pm UTC](https://community.auth0.com/t/action-to-deny-login-with-message/91711/1 "2022-10-03T16:03:26Z")

</div>

Trying to implement something I thought would be very simple but am starting to believe is not.

Have read numerous discussions on how Auth0 does not provide Password Expiration out of the box. While that seems very strange, there were numerous examples of “Rules” being used to enforce this.

However, all of these examples are legacy “Rules”, not “Actions”, and also seem to continue the login process regardless of my actions.

I have created an Action replicating the given rule, but the error is being pushed to my own application with the configured message:

`api.access.deny("Your password has expired. Please reset your password.");`

Is there not some simple way to, based on the Post-Login Action, deny the login and present the user with a message on the Universal Login page?

I feel like this should be trivially simple; given the conditions I check in post-login, the login is reversed/denied, and the user is redirected back to the login screen with an error message prompt indicating they need to reset their password via the mechanism on the Universal Login page. I don’t see why a series of redirect back and forth with the application behind the Auth0 login are needed for something like this?

---

<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:** [October 4, 2022, 9:52pm UTC](https://community.auth0.com/t/action-to-deny-login-with-message/91711/3 "2022-10-04T21:52:36Z")

</div>

Hey @michaelh welcome to the community!

> [@michaelh](#):
>
> Is there not some simple way to, based on the Post-Login Action, deny the login and present the user with a message on the Universal Login page?

Unfortunately there isn’t currently a way to achieve this currently:

> [@Deny users with certain roles at login](https://community.auth0.com/t/deny-users-with-certain-roles-at-login/91118/6):
>
> Awesome, thanks for sharing! There’s no OOTB support for redirecting a user to Universal Login with the error message - As it stands your application will need to handle what to do next with the error params/user returned to the callback. What I have seen in this scenario is a user being presented with some sort of error page (using the error params) and an option to click to bring up universal login once more with ([loginWithRedirect({prompt: ‘login’})](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#loginwithredirect)) for example.

I did quick search of our [feedback section](https://community.auth0.com/c/feedback/95) and didn’t see anything directly related to this so I’d recommend creating a request yourself if you’re interested!

---

<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 18, 2022, 9:52pm UTC](https://community.auth0.com/t/action-to-deny-login-with-message/91711/4 "2022-10-18T21:52:40Z")

</div>

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