Show error after api.access.deny in password reset post challenge action

Hey,

I have an Action placed on the password reset / post challenge trigger. In this action, the user is redirected to our application for an extra challenge. This challenge can at times fail for reasons out of the control of the user, and in those cases, I would like to show an error message to them.

I have attempted to use the api.access.deny(error-message) function, but I’m just sent back to Universal Login with a sort of default screen saying ‘Something went wrong. Please return to the login page and select “Forgot Your Password” to try again.’

I would like to either be redirected back to our own page, or even better, have the error message be shown in the Universal Login error page. Reading the Post-challenge Api docs it says the message “may be presented directly in end-user interfaces.” Under what circumstances?

Hi @samuel.berre,

Welcome to the Auth0 Community!

You are seeing the generic “Something went wrong” page because the Universal Login password reset flow does not display the custom message provided to api.access.deny(). The best way to show a custom error is to redirect the user to your own application’s error page using api.redirect.sendUserTo().

If you have any further questions, please don’t hesitate to reach out.

Have a good one,
Vlad