nuxt-auth icon indicating copy to clipboard operation
nuxt-auth copied to clipboard

RefreshHandler failing to find refreshToken value

Open AidosMarcos opened this issue 1 year ago • 0 comments

Environment

  • Operating System: Windows_NT
  • Node Version: v18.13.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: ssr, typescript, vite, modules, auth, app, nitro, sourcemap, devServerHandlers
  • Runtime Modules: @sidebase/[email protected], @pinia/[email protected]
  • Build Modules: -

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

AidosMarcos avatar Aug 02 '24 10:08 AidosMarcos