Unfortunately, if you have a custom HTML universal login page AND you want to show specific errors from Actions. you are UNABLE to do that. It will only show “WE’RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP.”
When code in Actions runs the following line: api.access.deny('cant-signup-with-this-domain', "This domain is prohibited from signing up")
, the response coming back to the user’s frontend looks like this:
{
"name":"InternalExtensibilityError",
"statusCode":400,
"code":"extensibility_error",
"message":"cant-signup-with-this-domain",
"friendly_message":"This domain is prohibited from signing up",
"description":"Denied ",
"fromSandbox":true}
}
One would expect that if the error contains “friendly_message”, the universal login page would show it, but instead it checks the constant strings defined in the languageDictionary
(in error.signUp.extensionabilty_error
and error.lock.fallback
)
A not-so-good workaround was suggested by a user:
This workaround suggest bad UX: having to distinguish between the errors in the frontend and displaying it as alert instead of the awesome red banner.
Having custom errors normally is possible since that same user reported that it works perfectly if you’re using “New Universal Login with no custom html/js”.
Bottom line, Auth0, please let us display custom errors from the Actions straight to the custom HTML error pane.
Acceptable solutions:
- Letting
api.access.deny(reason, friendly_message
dictate the message for the frontend. - Let us control the error pane completely using
lock.on("signup error")
: give us the option to change the text of the error pane according to the error that was received.