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.32k stars 165 forks source link

fix: Refresh not triggered if the access token is not also known, which limits its purpose #902

Open cip8 opened 2 months ago

cip8 commented 2 months ago

๐Ÿ”— Linked issue

890 [second part]

โ“ Type of change

๐Ÿ“š Description

The refresh logic should be triggered if the refresh token is known.

Some backends might require both tokens for a refresh, but this is not default behavior.

Refresh tokens are long-lasting and usually expire after access tokens, so requiring both for a successful refresh should be optional.

๐Ÿ“ Checklist

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

pnpm add https://pkg.pr.new/@sidebase/nuxt-auth@902

commit: f8ca293

cip8 commented 2 months ago

Fix is incomplete - logout doesn't clear refresh cookie so the user re-authenticates on each visit. Will update soon.

cip8 commented 2 months ago

Tested with my local setup, everything works fine now.