Update AuthProvider.tsx
This commit is contained in:
@@ -19,19 +19,19 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|||||||
const [userFetchState, fetchUser] = useAsyncFn(getUserDetails);
|
const [userFetchState, fetchUser] = useAsyncFn(getUserDetails);
|
||||||
|
|
||||||
// ! REMOVING FOR TESTING MULTIPLE CLIENTS
|
// ! REMOVING FOR TESTING MULTIPLE CLIENTS
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
// on load of this, if we already have jwt tokens in store,
|
// // on load of this, if we already have jwt tokens in store,
|
||||||
// then try using them with auth check
|
// // then try using them with auth check
|
||||||
window.electronAPI.store.get(STORE_ITEMS.AUTH_SESSION_JWT).then((jwtToken: string) => {
|
// window.electronAPI.store.get(STORE_ITEMS.AUTH_SESSION_JWT).then((jwtToken: string) => {
|
||||||
if (jwtToken) {
|
// if (jwtToken) {
|
||||||
setJwtToken(jwtToken);
|
// setJwtToken(jwtToken);
|
||||||
|
|
||||||
console.log('retrieved jwtToken from storage', jwtToken);
|
// console.log('retrieved jwtToken from storage', jwtToken);
|
||||||
} else {
|
// } else {
|
||||||
console.log('no jwt token in store');
|
// console.log('no jwt token in store');
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}, []);
|
// }, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (jwtToken) {
|
if (jwtToken) {
|
||||||
|
|||||||
Reference in New Issue
Block a user