Returning unauthrized error in rule call back sends to unresolved url. cant continue

we have the following rule - we would like to raise a flag and discontinue login based on a certain logic
how ever the callback is received with error and state, and nothing can be done.
we would like to show a certain error page or custom error page but it looks the app goes to a dead end trying to load that error url page over and over again.
we are using latest Angular as a frontend.
errored url:



function (user, context, callback) {
  user.app_metadata = user.app_metadata || {};
  if (user.app_metadata.some_boolean) {
    return callback(new UnauthorizedError('some text'), user, context);
    //return callback(null, user, context);
  } else {
    return callback(null, user, context);
1 Like

Hey @cardauth

This is the method that Auth0 uses to send the authorization response back to the application.
Basically, your Angular frontend will have to look at the URL for the error and error_description parameters in the query string and, when found, use them to display an error page.

For example, in the Angular quickstart, you would handle that here:


  if (params.includes('error=')  {
    // show an error page

Hey nicolas_sabena.
thanks for the reply.
unfortunatly it doesnt work,
trying to redirect or any line of code in the scope keeps the page refreshed with the same error in the url
nothing happens…
im able to call the logout from that block, but i want to show an error page to the user.
still struggling.