From 03c4509792884ae6fd9ba2185c51cae12e5db05e Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Mon, 6 Mar 2023 09:17:54 +0100 Subject: [PATCH] clean store onmount if forbidden access --- front/volume/src/Auth.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/front/volume/src/Auth.ts b/front/volume/src/Auth.ts index 9575fa4..69af3d0 100644 --- a/front/volume/src/Auth.ts +++ b/front/volume/src/Auth.ts @@ -20,10 +20,8 @@ export async function getUser() { referrerPolicy: "no-referrer", }); let user = await res.json(); - if (user.username) { - console.log(user); - store.set(user); - } + if (user.username) store.set(user); + else store.set(null); } export function login() {