# Show authorization error on universal login page after rule

**URL:** <https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060>\
**Category:** Get Help\
**Tags:** login\
**Created:** [May 9, 2019, 3:44pm UTC](https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060 "2019-05-09T15:44:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wordnik](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wordnik/32/12949_2.png) [@wordnik](https://community.auth0.com/u/wordnik)\
**Post date:** [May 9, 2019, 3:44pm UTC](https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060/1 "2019-05-09T15:44:19Z")

</div>

Hi! I want to enforce email verification before signup. I have used a rule as suggested [here](https://auth0.com/rules/email-verified).

However, it’s unclear how to tell the user in the Universal Login window that they need to verify their email before logging in. I also cannot get the Universal login to show a flash error if the user is not verified.

Here’s the code I added to the login customization script in my dashboard:

```
lock.on("authorization_error", function(error) {
              lock.show({
                loginAfterSignUp: false,
                flashMessage:{
                  type: 'error',
                  text: error.error_description
                }
              });
            })

```

This does not fire; it only redirects the user to the login screen again without an error. I want to keep the user in the UI window rather than redirecting to a page in my application. How can I accomplish this?

---

<div class="post-metadata">

**Author:** ![wordnik](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wordnik/32/12949_2.png) [@wordnik](https://community.auth0.com/u/wordnik)\
**Post date:** [May 9, 2019, 5:09pm UTC](https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060/2 "2019-05-09T17:09:58Z")

</div>

I ended up using the solution shown here: [http://community.auth0.com/t/handling-authorization-error-with-hosted-pages/9931/13](http://community.auth0.com/t/handling-authorization-error-with-hosted-pages/9931/13)

---

<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:** [May 9, 2019, 8:18pm UTC](https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060/3 "2019-05-09T20:18:47Z")

</div>

Hi @wordnik,

Welcome to the Auth0 Community!

Glad you were able to figure out a solution so quickly. Let us know if you have any more questions.

Best,  
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:** [May 24, 2019, 8:18pm UTC](https://community.auth0.com/t/show-authorization-error-on-universal-login-page-after-rule/25060/4 "2019-05-24T20:18:48Z")

</div>

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