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

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

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!

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

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

1 Like

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.

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