From cb2e82a28df9d07696d56f4c2679dec84570901c Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 20 Jun 2022 08:10:00 -0500 Subject: [PATCH] Update AuthProvider.tsx --- .../desktop/src/providers/AuthProvider.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/desktop/src/providers/AuthProvider.tsx b/packages/desktop/src/providers/AuthProvider.tsx index 9031b12..a772255 100644 --- a/packages/desktop/src/providers/AuthProvider.tsx +++ b/packages/desktop/src/providers/AuthProvider.tsx @@ -20,19 +20,19 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { const [userFetchState, fetchUser] = useAsyncFn(getUserDetails); // ! REMOVING FOR TESTING MULTIPLE CLIENTS - // useEffect(() => { - // // on load of this, if we already have jwt tokens in store, - // // then try using them with auth check - // window.electronAPI.store.get(STORE_ITEMS.AUTH_SESSION_JWT).then((jwtToken: string) => { - // if (jwtToken) { - // setJwtToken(jwtToken); + useEffect(() => { + // on load of this, if we already have jwt tokens in store, + // then try using them with auth check + window.electronAPI.store.get(STORE_ITEMS.AUTH_SESSION_JWT).then((jwtToken: string) => { + if (jwtToken) { + setJwtToken(jwtToken); - // console.log('retrieved jwtToken from storage', jwtToken); - // } else { - // console.log('no jwt token in store'); - // } - // }); - // }, []); + console.log('retrieved jwtToken from storage', jwtToken); + } else { + console.log('no jwt token in store'); + } + }); + }, []); // todo: check this in intervals repeatedly useEffect(() => {