Replies: 2 comments 1 reply
-
Something like export async function getServerSideProps(ctx) {
const { query: { state } } = ctx;
const response = await fetch(`https://accounts.google.com/o/oauth2/v2/auth?state=${state}`);
const data = await response.json();
return {
props: {
data
},
};
} Can see the state key in the ctx, so imagine thats what you need |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi there @TejasQ! 🙂 Do you think #823 would help here? It makes it possible to forward any parameters when signing in to your IdP |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Your question
Hi, I love the great work done on this project. Thank you all very, very much.
My question is about the
state
parameter from the OAuth spec. Traditionally, one would pass it to an OAuth provider, say Google like soAfter login, Google redirects to the callback URL with the state attached to the querystring, ready to be processed by the client.
I have searched a lot for a way to access this parameter with next-auth, but have not yet found out how.
My question is twofold:
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
Beta Was this translation helpful? Give feedback.
All reactions