state not being sent
See original GitHub issue<your detailed question and code samples go here>
For some reason my state parameters are not being places into the final url on generateAuthUrl().
My client id, secrets, access type, scopes, and redirect_uri are all generated correctly,
using this code:
let url = this.client.generateAuthUrl({
// 'online' (default) or 'offline' (gets refresh_token)
access_type: 'offline',
// If you only need one scope you can pass it as a string
scope: SCOPES,
// Optional property that passes state parameters to redirect URI
state: {foo: "bar", email: emailAddress, "test": "one"}
});
I get
https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fmail.google.com%2F&state=&response_type=code&client_id=xxx.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A9000%2Foauth2callback%2Fgoogle
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Sending state with react router not working - Stack Overflow
I have checked the state in the react dev tools, and tested with Jest, but both show that state is not being forwarded...
Read more >Why React doesn't update state immediately - LogRocket Blog
State updates in React are asynchronous; when an update is requested, there is no guarantee that the updates will be made immediately.
Read more >US Constitution - SOS.ri.gov
Rhode Island was the only state not to send delegates to the Constitutional Convention in 1787. Then, when asked to convene a state...
Read more >Frequently Asked Questions - California Secretary of State
The Secretary of State does not issue licenses or permits for business ... Similar letters are being sent to California limited liability companies....
Read more >Election Security Rumor vs. Reality - CISA
Rumor: Voting system software is not reviewed or tested and can be easily manipulated. Get the Facts: State and local election officials ...
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 FreeTop 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
Top GitHub Comments
Stringifying and enconding
state
object did the trick as @matkoklaic mentioned.This should be included in the documentation.
Just make sure to stringify and encode state object passed to
generateAuthUrl
function:state: encodeURIComponent(JSON.stringify(state))
.