Session update on client side components when jwt callback updates session #11984
Unanswered
lucifer-simplai
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.
-
I have created a Next js application using Next-auth.I am using custom backend to maintain the user session and details.
Now the issue I am facing is, I want to update my session (both client side and server side). based on the conditions I have added in jwt callback. but client side session is not updated even though I have returned the updated session from jwt and session callback.
I my session I have added a key expiresAt (time at which my current session expires on backend). and when this time is exceeded I call getSession api can update my sessionId. which is also stored in my session. now this is not taking affect for client side components as I need the updated session id in my client components as well as api interceptor. for which now I have to call getSession method before each api call which added unnecessary latency.
How can I fix this.
Additionally when I call logout the api takes some time and if any other api is called in between the session does not expire and is refresehd because the later api call. would be helpful If I can get suggestion to fix this as well
Beta Was this translation helpful? Give feedback.
All reactions