getSession serverside don't trigger visibilityChange event to refresh token #4038
Unanswered
killjoy2013
asked this question in
Help
Replies: 2 comments 1 reply
-
Hi @balazsorban44, |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have this problem too |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Question 💬
Hi,
Using
"next-auth": "^4.2.1",
with CredentialsProvider. Already implemented token rotation and is working alright. On the client side, useSession hook refreshes the session token when it expires. I need to obtain the token to use in my GraphQL query in getServerSideProps like this;As long as I keep the same browser open, this works fine. However, If I close the browser, and come back after token expiresIn period, open a new browser and navigate directly to my page
http://localhost:3000/cities
, old token, wich was in the session cookie when I've closed the browser, returns fromgetToken
. I'm expecting callinggetSession
withtrigger
&event
parameters would force jwt process and creates a new token, as in client side. Am I missing anything? What are the purpose of event, triggerEvent & broadcast parameters then?Thanks in advance
How to reproduce ☕️
use the code below in getServerSideProps. Navigate to your page directly, like
http://localhost:3000/cities
after token life time.Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions