sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.25k stars 162 forks source link

RefreshHandler failing to find refreshToken value #842

Open AidosMarcos opened 1 month ago

AidosMarcos commented 1 month ago

Environment

Reproduction

My configs

auth: { baseURL: 'https://xxx.xxx.xxx.xxx:xxxx/api/user/', globalAppMiddleware: true, sessionRefresh: { enablePeriodically: 1200000, enableOnWindowFocus: true, }, provider: { type: 'refresh', token: { signInResponseTokenPointer: '/tokens/token', type: 'Bearer', headerName: 'Authorization', maxAgeInSeconds: 300, }, refreshToken: { signInResponseRefreshTokenPointer: '/tokens/refreshToken', refreshRequestTokenPointer: 'Bearer', maxAgeInSeconds: 28800, }, pages: { login: '/login' }, endpoints: { signIn: { path: 'login', method: 'post' }, signOut: { path: 'logout', method: 'post' }, signUp: undefined, getSession: undefined, refresh: { path: 'refresh', method: 'post' } } } }

I have my external API handling requests, login works and i correctly save the values of Token and RefreshToken

Describe the bug

When refresh automaticly sets off refreshHandle fails to find refreshToken value and stops the process.

Confirmed i have the token cookies with correct values, and all pointers are correct. image

Additional context

I was able to verify that the refreshToken is correctly saved

const { status, token, refreshToken } = useAuth(); console.log(refreshToken.value);

And the token was correct

Logs

No response