Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2105] Skip redirect callback #148

Merged
merged 3 commits into from
Oct 28, 2020
Merged

Conversation

adamjmcgrath
Copy link
Contributor

Description

auth0-react can clash with other OAuth clients on the same page because it doesn't allow the user to control how and when handleRedirectCallback get's fired.

Add the config option skipRedirectCallback, if true this will ignore the code/state url parameters that might be there because of a different client's auth flow.

You can apply this setting to be true on callback routes for other OAuth providers where you know the SDK doesn't need to handle the callback params. Or conversely, you can set it to true, unless you know the route to be the auth0 callback path, eg

<Auth0Provider
  domain={domain}
  clientId={clientId}
  redirectUri={`${window.location.origin}/auth0-callback`}
  skipRedirectCallback={window.location.pathname !== '/auth0-callback'}>

References

Fixes #126

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@adamjmcgrath adamjmcgrath requested a review from a team as a code owner October 28, 2020 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auth0-callback breaks LinkedIn OAuth-flow
2 participants