mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
fix: prevent authenticated UI flash when server rejects JWT session (#2387)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user