fix: prevent authenticated UI flash when server rejects JWT session (#2387)

This commit is contained in:
Tink 2026-03-11 09:37:46 +01:00 committed by GitHub
parent c57c884fd4
commit 28cc9e0571
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -337,7 +337,14 @@ export const useAuthStore = defineStore('auth', () => {
}
if (isAuthenticated) {
await refreshUserInfo()
const user = await refreshUserInfo()
if (!user) {
// refreshUserInfo() did not return a user — either the
// token vanished or a 4xx triggered logout(). Bail out
// so the stale local `isAuthenticated` doesn't override
// the auth state that logout() already set.
return
}
}
}