Why are route parameters removed from URL when state parameter exists

Hi,

In my Angular application I am trying to route to a custom error component when a user tries to login with a blocked auth0 account. Auth0 redirects the failed login to /?error=unauthorized&error_description=user is blocked&state=STV%2BUUFKbG5SOEVFeXA2Qy5UbGFRWEw3NjBIMDctRXFhVDhvZmFZbGxHaQ%3D%3D

My idea is to listen to the route parameters and when “unauthorized” is detected, route to /error. The component at /error will show a prettier error message telling the user that their account is locked and instructions on how to go about unlocking it.

However, the state parameter seems to be causing an issue. The URL mentioned above is shown for a split second, then it gets deleted and replaced with just . My subscription to the route parameters never detects the error, error_description, or state parameters. Removing the state parameter from the URL and manually navigating, results in the desired behaviour where the subscription detects error and error_description and can route as desired.

Does anyone have any experience with this problem?

Thanks

  • Which SDK this is regarding: auth0-angular
  • SDK Version: 1.10.0
  • Platform Version: angular version 14.0.4