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
What is the improvement or update you wish to see?
I was trying to fetch the session client side to get the sessionToken. The sessionToken would only sometimes be available in the session (e.g. when I refresh the page). To resolve this, I needed to add
async session({ session }) {
return session;
},
in the session callbacks to force NextAuth to return the entire session each time. If this is the intended behaviour, it would be good to include this in the documentation.
Is there any context that might help us understand?
My setup:
On the top level, I have everything wrapped in the following (note I need a custom basePath):
What is the improvement or update you wish to see?
I was trying to fetch the session client side to get the sessionToken. The sessionToken would only sometimes be available in the session (e.g. when I refresh the page). To resolve this, I needed to add
in the session callbacks to force NextAuth to return the entire session each time. If this is the intended behaviour, it would be good to include this in the documentation.
Is there any context that might help us understand?
My setup:
useQuery
to make a call to my custom NestJS backend and need to pass it the session token in the authorisation headers.useSession
, the sessionToken would only be present sometimes (I am assuming that there must be some caching)Note: I am using a
Resend
provider and aPrismaAdapter
I don't know if this is the intended behaviour but would be great to include it in the docs if so 🙏
Thank you!
Does the docs page already exist? Please link to it.
No response
The text was updated successfully, but these errors were encountered: