Update AuthProvider.tsx

This commit is contained in:
talksik
2022-06-20 08:10:00 -05:00
parent 8864fba55f
commit cb2e82a28d
+12 -12
View File
@@ -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(() => {