fix: reset throttle on logout so checkAuth clears auth state

logout() calls checkAuth() to clear the authenticated flag and user
info. But since checkAuth() likely ran within the last minute (on the
navigation that triggered logout), the now-working throttle would
return early, leaving authenticated=true in the store despite the
token being removed. This could cause Login.vue to redirect back
to home.

Resetting lastUserInfoRefresh to null before checkAuth() ensures
the logout flow always runs fully.
This commit is contained in:
kolaente
2026-02-21 23:00:51 +01:00
parent 65806df605
commit 4cee2cf128

View File

@@ -452,6 +452,7 @@ export const useAuthStore = defineStore('auth', () => {
removeToken()
const loggedInVia = getLoggedInVia()
window.localStorage.clear() // Clear all settings and history we might have saved in local storage.
lastUserInfoRefresh.value = null
await router.push({name: 'user.login'})
await checkAuth()