diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 4109adf..179ac89 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -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() } } })