# Question about handling failed logins from blocked users

**URL:** <https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813>\
**Category:** Get Help\
**Created:** [October 5, 2022, 9:52am UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813 "2022-10-05T09:52:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patara.kulratanayan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patara.kulratanayan/32/33718_2.png) [@patara.kulratanayan](https://community.auth0.com/u/patara.kulratanayan)\
**Post date:** [October 5, 2022, 9:52am UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813/1 "2022-10-05T09:52:16Z")

</div>

Hi  
We are using the Classic Universal Login with the Lock widget.  
I’d like to ask a question about handling failed logins from blocked users.

Scenario#1:  
If the user is blocked due to multiple failed login attempts(Brute force detection), then if the user logs in again:  
This call /usernamepassword/login returns 429.  
The user will stay in the Auth0 login page, and see the error message up top.  
We just need to customize the error message to fit our need. So far so good

Scenario#2:  
If the user is blocked from Auth0 console: User Management=\>Users=\>Select the user and block, then when the user logs in. Then if the user logs in again:  
This call /usernamepassword/login returns 200

Eventually Auth0 will call back to the app with error message in the URL: - “[https://myapp/?error=unauthorized&error\_description=user](https://myapp/?error=unauthorized&error_description=user) is blocked&state=state”

For this scenario, since Auth0 redirects back to the app, the app will need to handle this error and display an error message, so there is some work to be done in the app.

Question:

- For scenario#2, is it possible to config Auth0 so that the blocked user stay in the Auth0 login page after the failed login attempt, and display the error message in the login page like Scenario#1? Maybe with a different error message?

Thanks

---

<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 11, 2022, 11:14pm UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813/3 "2022-10-11T23:14:12Z")

</div>

Hi there @patara.kulratanayan! I apologize for the delay here but wanted to get back on this one. It is unfortunately not possible to keep the user within the context of Universal Login in this scenario. That is, Auth0 will always redirect to the application with the relevant params which is expected to handle it. The following post elaborates on this a bit:

> [@Univeral Login (Classic) and Blocked Users](https://community.auth0.com/t/univeral-login-classic-and-blocked-users/57619/7):
>
> You are correct! I was mistaken about the rules piece when it comes to blocked users. Sorry for any confusion that might have caused! If you take a look at the [Block and Unblock Users](https://auth0.com/docs/users/block-and-unblock-users#block-a-user) docs, it notes: If a blocked user tries to access an application, they will be redirected to the application with the error message user is blocked in the URL. The change in behavior is due to using the Universal Login instead of an embedded login. There are many security benefits to using the Universal Login…

We have an existing feedback request that I recommend upvoting if you can! Our product team monitors these closely for community engagement. 👇

> [@Custom errors for Universal Login Page](https://community.auth0.com/t/custom-errors-for-universal-login-page/69844):
>
> Feature: Parameter to pass a custom error message to the Auth0 hosted universal login. Description: Currently it is not possible to pass a custom error message when calling the browser SDK loginWithRedirect method that is then displayed on the Auth0 hosted Universal Login. Use-case: Our login completely relies on the Auth0 hosted Login Page and we do not have any page implemented for not logged in users (and therefore no place to show error messages to login scenarios). Our current use-case i…

---

<div class="post-metadata">

**Author:** ![patara.kulratanayan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patara.kulratanayan/32/33718_2.png) [@patara.kulratanayan](https://community.auth0.com/u/patara.kulratanayan)\
**Post date:** [October 12, 2022, 1:13am UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813/4 "2022-10-12T01:13:09Z")

</div>

Thank you for the information.

---

<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 12, 2022, 3:41pm UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813/5 "2022-10-12T15:41:43Z")

</div>

No problem, happy to help where I can! 😄

---

<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 26, 2022, 3:41pm UTC](https://community.auth0.com/t/question-about-handling-failed-logins-from-blocked-users/91813/6 "2022-10-26T15:41:47Z")

</div>

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