https://supertokens.com/ logo
Title
i

ikak

02/13/2023, 12:45 PM
Hey everyone. I am using supertokens with nextjs and fastapi and everything is working fine just that in the frontend refresh token is not getting set. I tried using React and it is working fine, so is this an issue with nextjs? Edit: If I delete all 3 cookies and then hard refresh the page, the refresh token gets set,
r

rp

02/13/2023, 1:18 PM
hey @ikak the refresh token is shown in cookie storage only when you navigate to the refresh API path on chrome. Otherwise chrome hides it.
i

ikak

02/13/2023, 1:26 PM
@rp So do I have to hit some route to get the refresh token?
r

rp

02/13/2023, 1:31 PM
not really. If the access token stuff is working, then the refresh token is also saved in the browser. Just that chrome doesn't show it until you visit the refresh API path on chrome
i

ikak

02/13/2023, 1:40 PM
@rp what is this st-last-access-token-update? What value does it store?
r

rp

02/13/2023, 1:41 PM
it stores the last time the access token was updated. So it's time in milliseconds
If you visit the refresh API path on the browser, you should see the sRefreshToken cookie
i

ikak

02/13/2023, 1:42 PM
What is the endpoint for this refresh api path?
r

rp

02/13/2023, 1:42 PM
by default it is /auth/session/refresh
but it depends on the configured apiBasePath
i

ikak

02/13/2023, 1:43 PM
Ohh got it thanks a lot
r

rp

02/13/2023, 1:43 PM
👍
i

ikak

02/13/2023, 1:44 PM
But after hitting that endpoint also it won't show the refresh token in the cookie storage. AM I correct?
r

rp

02/13/2023, 1:45 PM
it should
if you navigate to that endpoint on your browser, it should
i

ikak

02/13/2023, 1:48 PM
If I go to /auth/session/refresh it does show the refresh token but I go to any other page and then refresh the page again, it hides the refresh token again.
r

rp

02/13/2023, 1:48 PM
yea. thats just chrome doing its thing
i

ikak

02/13/2023, 1:49 PM
ohh ok and just one more thing if chrome is not showing the refresh token, then does access token get refreshed automatically?
r

rp

02/13/2023, 1:50 PM
yes
i

ikak

02/13/2023, 1:50 PM
ok thanks a lot sir