Open julienguillot77 opened 3 days ago
After some debugging, I realized that the access_token and refresh_token stored in the app state are the old one, and those in the cookie are the valid one. But the tokens that are used during the refresh are those of the app state, right? Is is intentional or something needs to be done on my side (or package side ?)
Additional info :
If I disable SSR from nuxt.config.ts, the tokens stored in cookie and state are now the same.
Environment
Darwin
v20.17.0
3.14.1592
3.15.0
2.10.4
yarn@1.22.22
-
default
@nuxt/image@1.8.1
,@sidebase/nuxt-auth@0.9.4
,@nuxt/icon@1.9.0
,@nuxtjs/tailwindcss@6.12.2
,shadcn-nuxt@0.11.3
,@vueuse/nuxt@12.0.0
,@nuxtjs/color-mode@3.5.2
,@nuxt/fonts@0.10.2
,@pinia/nuxt@0.8.0
,nuxt-lodash@2.5.3
,nuxt-zod-i18n@1.11.0
,@nuxtjs/i18n@9.1.0
-
Reproduction
Set your nuxt.config.ts auth options :
signIn to your app
Describe the bug
I can't say it's a bug or it's volountary but this, I think, a strange behaviour.
The refresh token API endpoint is called at the same time as session refresh.
A first attempt of session refresh is done right after the signIn process. The returned access_token and refresh_token are rightly set to auth state and cookies but the next refresh tentative is still using the previous refresh_token...
Am I missing something or an issue really occurs ?
Is refreshing tokens in same time as session refresh a normal behaviour ?
Additional context
No response
Logs
No response