# Auth0 Action api.access.deny is not displaying the provided error message to the user

**URL:** <https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163>\
**Category:** Get Help\
**Tags:** login, auth0\
**Created:** [October 11, 2022, 3:34pm UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163 "2022-10-11T15:34:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![faisal1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/faisal1/32/25387_2.png) [@faisal1](https://community.auth0.com/u/faisal1)\
**Post date:** [October 11, 2022, 3:34pm UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163/1 "2022-10-11T15:34:14Z")

</div>

We have added a post login Auth0 Action with api.access.deny(“custom message”) but this message is not being displayed to the user. Instead, it just displays “We’re sorry. Something went wrong when attempting to sign up”.

What can be the cause of this bug. Please let me know if there is a way to debug this. Thanks

 ![Screenshot 2022-10-13 at 9.59.01 AM](https://global.discourse-cdn.com/auth0/original/3X/b/1/b117cafa901faf0216fa858670f7bcd54c9599e4.png)

---

<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 21, 2022, 12:01am UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163/3 "2022-10-21T00:01:27Z")

</div>

Hey there @faisal1!

Sorry for the delayed response here - In the screenshot it looks like you’re getting that error on registration rather than login. Are you attempting to return an error to users in the context of a denied registration or login?

The more details you can provide about your use case the better!

---

<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 10, 2022, 6:13am UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163/4 "2022-11-10T06:13:06Z")

</div>

I have this same issue where I have an action as a pre-user registration action, which will return api.access.deny with a message.

And that message is not shown in my signup lock form, only the default message is shown.

It means I am not able to use Actions and I’ll have to keep using Rules which are able to send back a customised error message to the Lock/Universal Login.

[Here is my similar post](https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025)

EDIT: I did discover a way to show the error in the end for the old Lock [Pre-Registration Action calls api.access.deny, how to show specific message in Universal Login - #4 by jesse2](https://community.auth0.com/t/pre-registration-action-calls-api-access-deny-how-to-show-specific-message-in-universal-login/94025/4)

---

<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:** [December 20, 2022, 9:51pm UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163/5 "2022-12-20T21:51:44Z")

</div>

> [@jesse2](#):
>
> And that message is not shown in my signup lock form, only the default message is shown.
> 
> It means I am not able to use Actions and I’ll have to keep using Rules which are able to send back a customised error message to the Lock/Universal Login.

Thanks for following up on this and sharing your solution in another thread - To clarify (This is regarding New Universal Login), it _is_ possible to show a custom error message to a user via a pre user registration action, using `api.access.deny(reason, userMessage)`. It is _not_ possible to show a similar custom error message via a post login action - Instead the `reason` provided in `api.access.deny(reason)` is included as a query param at the url the user is redirected back to.

> **[Actions Triggers: pre-user-registration - API Object](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow/api-object)**
>
> Learn about the pre-user-registration Action trigger's API object.

> **[Actions Triggers: post-login - API Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/api-object)**
>
> Learn about the post-login Action trigger's API object.

---

<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:** [January 3, 2023, 9:52pm UTC](https://community.auth0.com/t/auth0-action-api-access-deny-is-not-displaying-the-provided-error-message-to-the-user/92163/6 "2023-01-03T21:52:26Z")

</div>

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