From 10bad9544067f1e84258a3450e6b39f2fd8f8d73 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 2 Jul 2024 12:27:19 +0200 Subject: [PATCH] fix(auth): log user out when the current account does not exist --- frontend/src/stores/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index a6a69d418..f4c36bfd7 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -307,7 +307,7 @@ export const useAuthStore = defineStore('auth', () => { return newUser } catch (e) { - if(e?.response?.status === 401 || + if((e?.response?.status >= 400 && e?.response?.status < 500) || e?.response?.data?.message === 'missing, malformed, expired or otherwise invalid token provided') { await logout() return