Setting "code" query parameter breaks auth0 state
See original GitHub issueIf you’re logged in to my site, and then add “?code=blah” to the href, auth0 now thinks I’m not logged in. I realize this has something to do with the oauth redirect flow, but the problem is that I need to use that query parameter (stripe uses it for their oauth flow: https://stripe.com/docs/connect/collect-then-transfer-guide).
Proposed change: if code
param fails to change the auth0 state, auth0-react should fall back on whatever it would have the state be if that code were excluded (instead of just saying there’s no user).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:16 (6 by maintainers)
Top Results From Across the Web
How can I not have code and state parameters in the URL ...
A problem I encountered was that after a successful login, a code and state parameter are present in the URL of the SPA...
Read more >Troubleshoot WordPress Plugin Invalid State Errors - Auth0
The most common cause of the invalid state error is when the callback URL is cached on the server. Exclude caching on your...
Read more >Angular 10 SPA Error on redirect after login - Auth0 Community
Angular 10 SPA Error on redirect after login: there are no query params available for parsing - Auth0 Community.
Read more >Rules Execution Best Practices - Auth0
Learn about best practices for executing Auth0 rules.
Read more >Code Exchange removes query parameters from redirect URL
(I'm guessing) The Auth0 package assembles the redirect_uri and targetUrl from the cookie and redirects the user there, thereby removing the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @martinrojas - I am waiting on an upstream dependency before I do another release - should be 1 week - 2 max
Hi @dutsik @asktree
I have a branch (https://github.com/auth0/auth0-react/compare/skip-redirect-callback) where I’ve added the config option
skipRedirectCallback
, iftrue
this will ignore thecode
/state
parameters. You can apply this setting to betrue
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, egCan you try it out and let me know if it meets your needs?