sandrinodimattia / use-auth0-hooks

An easy way to sign in with Auth0 in your React application (client-side) using React Hooks
https://nextjs-spa-auth0-demo.now.sh/
MIT License
74 stars 31 forks source link

Redirect After Login Bouncing User Browser Around #26

Closed JenRob17 closed 4 years ago

JenRob17 commented 4 years ago

After supplying an onRedirectCallback function to the provider, the browser's address bar first strips the query string from the redirectUri which appears to be a redirect and then redirects the user to the appropriate page.

To some security paranoid users, this looks awkward and makes them think of scary words like, "man in the middle attack".

Propose that if onRedirectCallback is supplied, the redirectAfterLogin() function skips the window.history.replaceState call. If a consumer has gone to the trouble of supplying their own redirect callback function, they are likely going to be replacing the window history anyway.