Fix timezone resetting to UTC on page reload
On reload, the access token existed in localStorage so isAuthenticated was true, but user.value was null — fetchMe was never called, so authStore.timezone fell back to 'UTC' before the component mounted. Router guard now calls fetchMe() when authenticated but user data is not yet loaded, ensuring user preferences are available to all auth-required pages on the first render after a reload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,9 @@ router.beforeEach(async (to) => {
|
||||
if (!auth.isAuthenticated) {
|
||||
return { name: 'login', query: { redirect: to.fullPath } }
|
||||
}
|
||||
} else if (!auth.user) {
|
||||
// Token exists but user data not loaded yet (e.g. page reload) — fetch it now
|
||||
await auth.fetchMe()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user