From 08cbfd705fc5b5884b33d05bf19166e21517307c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 28 Jan 2021 14:51:24 +0000 Subject: [PATCH] Remove logOut call when refreshing the page and not logged in, to avoid changing the URL --- packages/client/src/store/auth.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/client/src/store/auth.js b/packages/client/src/store/auth.js index e01915ec7..29ded50ac 100644 --- a/packages/client/src/store/auth.js +++ b/packages/client/src/store/auth.js @@ -52,16 +52,8 @@ const createAuthStore = () => { // Or fetch the current user from localstorage in a real app else { - if (get(store) == null) { - const user = await API.fetchSelf() - if (user) { - store.set(user) - } else { - await logOut() - } - } else { - await logOut() - } + const user = await API.fetchSelf() + store.set(user) } }