You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm converting express-session to next-auth using OIDC.
I have made a custom provider follow this and I can get id_token on server side.
https://next-auth.js.org/configuration/providers/oauth
Also, Server-side means custom callback function /api/auth/callback/sso.js which I have made.
So I have to check follow token is valid.
Debug.log(req.body.id_token);
And I have implemented follow this.
https://next-auth.js.org/getting-started/example
const { data: session } = useSession()
console.log(session)
but the session is null.
F12 network log is /api/auth/session -> 304..
How do I get the session information on client side?
or how do I set the session information on the server side?
I don't know what I'm missing.
======================= Update ================================
../api/auth/[...nextauth].js
../api/auth/callback/sso.js
../pages/index.js
../pages/_app.js
Beta Was this translation helpful? Give feedback.
All reactions