From ad41d90a4512b2ae4747b1928c3cbdcf6fadbe24 Mon Sep 17 00:00:00 2001 From: wvffle Date: Fri, 5 Aug 2022 14:20:05 +0000 Subject: [PATCH] Check if user is authenticated when a page is created --- front/src/App.vue | 6 +++--- front/src/store/auth.ts | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index 34f88abe9..4bc357c44 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -69,9 +69,9 @@ const { width } = useWindowSize() const showSetInstanceModal = ref(false) // Fetch user data on startup -if (store.state.auth.authenticated) { - store.dispatch('auth/fetchUser') -} +// NOTE: We're not checking if we're authenticated in the store, +// because we want to learn if we are authenticated at all +store.dispatch('auth/fetchUser')