# Pre-Registration Action calls api.access.deny, how to show specific message in Universal Login

**URL:** <https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [November 9, 2022, 6:23am UTC](https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025 "2022-11-09T06:23:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jesse2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jesse2/32/13539_2.png) [@jesse2](https://community.auth0.com/u/jesse2)\
**Post date:** [November 14, 2022, 7:06am UTC](https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025/4 "2022-11-14T07:06:11Z")

</div>

Finally I did find a workaround:

If your action reports an error like this:

```auto
return api.access.deny(`something_happened`, `Something Specific Happened`);

```

Then in the old Lock (if you have custom html/css for your login branding), there is no way to see that specific message `Something Specific Happened` however you can at least detect that `any` action had an error, which come through as a `extensibility_error` type.

So in your customized html for the branding login you would have this as the languageDictionary you pass as the options to `var lock = new Auth0Lock(`

```auto
      languageDictionary.error = {
        signUp: {
          user_exists: `The user already exists, please use another email or <a class="text-link" href="${goBackURL}">go back and sign in</a> instead.`,
        	// All action alerts appear as extensibility_error, so if you need different errors in the future, use signup error handler below
          extensibility_error: `Your domain requires invitation so please wait while an admin invites you`
        }
      }

```

Now all errors in actions are caught as `extensibility_error` and that message is shown.

If you have more than one specific Action error, then you have to rely on raising `alert` for example:

```auto
    lock.on('signup error', function(error) {
      console.log(`A signup error occurred`, error);
      // In the future if we have more than one Action raising an error, this is the only way to show different errors, we have to use alerts.
      //if (error.code === 'extensibility_error' && 
      // error.description === 'domain_blocked_except_from_api') {
      // alert(`Your domain requires invitation so please wait while an admin invites you`);
      //}
    });

```

You can see all the possible events from [lock here](https://github.com/auth0/lock/blob/aee1e60e0fcd663660de2c2f9f12c7477836acd5/src/core.js#L39).

---

_[View the full topic](https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025)._
