URL redirection issue when URL contains the 'state' and 'code' query parameters because of the @auth0/auth0-angular

Angular = 9.0.0
@auth0/auth0-angular = 1.3.0

Problem Statement - The angular web app is not redirected correctly if the URL contains the ‘state’ and ‘code’ query parameters.

I am using a third-party app that sends customers to my angular web application.
That third-party app URL contains the ‘state’ and ‘code’ query parameters.
We could not control the third-party application.

When the URL contains the ‘state’ and ‘code’ query parameters, the application is redirected to the error path.

If I remove the error path from the Auth0 configuration, the application is redirected to the path: ‘**’ which I have defined at the last in the app-routing-module.ts

If I remove the state query parameter from the URL, the application is redirected to the correct route.

2 Likes

I too am experiencing this issue. Once authenticated, our users can connect a number of integrations, via oauth2, the callback contains code, which seems to be triggering the auth0 authGuard to redirect, loosing the original callback params.

@tractormatty I have resolved my issue by applying this configuration - skipRedirectCallback.

You may find more auth0 configuration here - AuthConfig | @auth0/auth0-angular

1 Like

@chirag I ended up coming across the same config setting. Thank you!