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
Hey all, this has been driving me absolutely insane lately trying to figure out whats going on. For some reason, when the JWT callback on my app runs, and the access/refresh token is refreshed, its not actually updating the properties on the token, user and session objects. Weirdly enough - if I refresh the actual page, the tokens seem to update perfectly fine, this only doesn't work when the JWT callback updates naturally or by making requests
GET /api/user/search?username=wwwwww 200 in 34ms (compile: 1925µs, render: 32ms)
Current access token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MThiNjZmYS1mMDg4LTRkYjgtYWYyNC00ZGFlOTAxMDg4MTUiLCJ1bmlxdWVfbmFtZSI6ImN3MDMiLCJqdGkiOiIzYzQyY2Y0Ni0yZWUxLTQxZjQtOWUzNy1hNzdiZjQ4MjAwYmUiLCJlbWFpbCI6ImNocmlzd2VsbHMyMDAxMjNAb3V0bG9vay5jb20iLCJleHAiOjE3NjU4MDE5MjUsImlzcyI6IlRlc3RGbHV4U2VydmVyIiwiYXVkIjoiVGVzdEZsdXhDbGllbnQifQ.NVxLnLYD8tz3Mjez1ZDwgYJgLdqE4x3ZiUKrhfeK_Bo
TOKEN ABOUT TO EXPIRE: 1765801925296
Refreshing token with refresh token: Lo7sO2Nt0Al/RSGtIHBlI9cP6LOkcPMYBeCbJzsAS/4=
Recieved refresh token JNrRIlHcAj6ITB9yrKSSWRkoP4dsmGma40SPGzaTJL0=
New access token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MThiNjZmYS1mMDg4LTRkYjgtYWYyNC00ZGFlOTAxMDg4MTUiLCJ1bmlxdWVfbmFtZSI6ImN3MDMiLCJqdGkiOiI1MjNmNWQxZS1kMzZkLTQ4ZDQtOTE1ZC1hN2MyZTU0OWZlZjMiLCJlbWFpbCI6ImNocmlzd2VsbHMyMDAxMjNAb3V0bG9vay5jb20iLCJleHAiOjE3NjU4MDE5ODUsImlzcyI6IlRlc3RGbHV4U2VydmVyIiwiYXVkIjoiVGVzdEZsdXhDbGllbnQifQ.2qXTPpYAVGZikGC-Ehn2xNvXrFTzln8PQ8YkDuobatM
GET /api/user/search?username=wwwwwww 200 in 49ms (compile: 1709µs, render: 47ms)
Current access token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MThiNjZmYS1mMDg4LTRkYjgtYWYyNC00ZGFlOTAxMDg4MTUiLCJ1bmlxdWVfbmFtZSI6ImN3MDMiLCJqdGkiOiIzYzQyY2Y0Ni0yZWUxLTQxZjQtOWUzNy1hNzdiZjQ4MjAwYmUiLCJlbWFpbCI6ImNocmlzd2VsbHMyMDAxMjNAb3V0bG9vay5jb20iLCJleHAiOjE3NjU4MDE5MjUsImlzcyI6IlRlc3RGbHV4U2VydmVyIiwiYXVkIjoiVGVzdEZsdXhDbGllbnQifQ.NVxLnLYD8tz3Mjez1ZDwgYJgLdqE4x3ZiUKrhfeK_Bo
TOKEN ABOUT TO EXPIRE: 1765801925296
Refreshing token with refresh token: Lo7sO2Nt0Al/RSGtIHBlI9cP6LOkcPMYBeCbJzsAS/4=
Recieved refresh token 1SCwi8Nib+dPcMDc0VgVZY6dK7/uRUrLcOwh6bsQL5k=
New access token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MThiNjZmYS1mMDg4LTRkYjgtYWYyNC00ZGFlOTAxMDg4MTUiLCJ1bmlxdWVfbmFtZSI6ImN3MDMiLCJqdGkiOiIyNWJlNjRmZS1mMmQ2LTQwZjUtOTg5ZS00OGVlYWJjZTg0ZWQiLCJlbWFpbCI6ImNocmlzd2VsbHMyMDAxMjNAb3V0bG9vay5jb20iLCJleHAiOjE3NjU4MDE5ODUsImlzcyI6IlRlc3RGbHV4U2VydmVyIiwiYXVkIjoiVGVzdEZsdXhDbGllbnQifQ.xHhPG50PfbeTzSUfcG9hknMNHITZqW3ayCMnu-DtD3Y
GET /api/user/search?username=wwwwwwww 200 in 44ms (compile: 1934µs, render: 42ms)
From the logs, we can clearly see that the old refresh/tokens are still being used in subsequent requests - does anyone have any ideas on this? I'm using getServerSession to make the calls from my frontend server to my backend server.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all, this has been driving me absolutely insane lately trying to figure out whats going on. For some reason, when the JWT callback on my app runs, and the access/refresh token is refreshed, its not actually updating the properties on the token, user and session objects. Weirdly enough - if I refresh the actual page, the tokens seem to update perfectly fine, this only doesn't work when the JWT callback updates naturally or by making requests
auth-options.ts:
next-auth.d.ts:
Logs:
From the logs, we can clearly see that the old refresh/tokens are still being used in subsequent requests - does anyone have any ideas on this? I'm using getServerSession to make the calls from my frontend server to my backend server.
Beta Was this translation helpful? Give feedback.
All reactions