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

fix(#834): Do not refresh on window focus for unprotected pages #858

Closed YoshimiShima closed 1 month ago

YoshimiShima commented 1 month ago

πŸ”— Linked issue

834

❓ Type of change

πŸ“š Description

The enableOnWindowFocus feature should not be triggered on pages that are accessible to unauthenticated users. Currently, when a user switches back to a tab containing an unauthenticated page (such as the login page of us), the refresh mechanism is still executed, which is unnecessary and potentially problematic. This pull request addresses that issue by ensuring that the enableOnWindowFocus feature is only executed when the user is in an authenticated state. This change prevents unnecessary refreshes on unauthenticated pages and eliminates potential problems associated with triggering the refresh mechanism on pages accessible to unauthenticated users.

πŸ“ Checklist