From 9eb5412c1420c006821bbed99d88443c0f6ee6da Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 5 Dec 2021 20:51:44 +0100 Subject: [PATCH] fix(api): Session is required to load current user --- api/src/stores/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/stores/main.ts b/api/src/stores/main.ts index 31db06c..af97178 100644 --- a/api/src/stores/main.ts +++ b/api/src/stores/main.ts @@ -70,10 +70,11 @@ export const useMainStore = defineStore({ const userStore = useUserStore(); try { const { data } = await api.post('/auth', { userid, password }); - this.user = await userStore.getUser(data.userid, true); this.session = fixSession(data); + this.user = await userStore.getUser(data.userid, true); return true; } catch ({ response }) { + this.handleLoggedOut(); return (response)?.status || false; } },