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
bugSomething isn't workingtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
1 participant
Converted from issue
This discussion was converted from issue #11441 on July 24, 2024 20:01.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Reproduction URL
https://github.com/renaldy23/nextauthjs-bug-session
Describe the issue
I'm trying to get current session user in API route next js, everthing works find if im hit the API via client component :


but when i try to hit the api via server component the session user is undefined :


im using Credentials provider. the configuration is like this :

How to reproduce
To reproduce the issue follow this step by step :
pnpm install
pnpx auth secret
pnpm dev
Expected behavior
i want to get current session user if im hit the API both from client component and server component
Beta Was this translation helpful? Give feedback.
All reactions