Next auth session inside route handlers
Unanswered
Rhinelander posted this in #help-forum
RhinelanderOP
Im trying to acces to my session datas to use my access token, but this one is 'null', any idea ?
6 Replies
@Rhinelander Im trying to acces to my session datas to use my access token, but this one is 'null', any idea ?
Are you fetching from a server component? If so, don’t do that, see https://nextjs-discord-common-questions.joulev.dev/fetching-own-api-endpoint-in-react-server-components and https://github.com/nextauthjs/next-auth/issues/7423
RhinelanderOP
Yes I am, but I dont understand how am i supposed to do it then ?
Here is the code in the server component
What do I need to change ?
@Rhinelander Yes I am, but I dont understand how am i supposed to do it then ?
Check the two links I sent above