Lack of Server-Side Session Update Capability (No updateSession() Equivalent) #12952
Unanswered
emiedonmokumo
asked this question in
Help
Replies: 0 comments
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.
-
Hi team,
While working with NextAuth.js in a Next.js project, I noticed a limitation that I wanted to discuss:
On the client side, it's possible to update the session using useSession().update()—this is useful for cases where some part of the user's session data needs to change dynamically.
However, on the server side, there doesn't seem to be any equivalent. For example, inside an API route or server action, after performing a task that logically requires a session refresh or change (not necessarily tied to a database), there's no documented way to update the current user's session.
Right now, we're left with workarounds like forcing a sign-in again or depending on JWT callbacks to inject data on the next session load.
Beta Was this translation helpful? Give feedback.
All reactions