From 3ef37b0b9e943b982bafec579a4ae5181724eaa1 Mon Sep 17 00:00:00 2001 From: ebube ojinta Date: Fri, 14 Apr 2023 14:12:29 -0700 Subject: [PATCH] login --- src/app/modules/auth/core/Auth.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/modules/auth/core/Auth.tsx b/src/app/modules/auth/core/Auth.tsx index 1c2f052..930131c 100644 --- a/src/app/modules/auth/core/Auth.tsx +++ b/src/app/modules/auth/core/Auth.tsx @@ -69,15 +69,18 @@ const AuthInit: FC = ({children}) => { const requestUser = async (apiToken: string) => { try { if (!didRequest.current) { - const {data} = await getUserByToken(apiToken) - if (data) { - setCurrentUser(data) + // const {data} = await getUserByToken(apiToken) + // if (data) { + // setCurrentUser(data) + // } + if(localStorage.getItem('kt-auth-react-v')){ + setCurrentUser(auth?.profile) } } } catch (error) { console.error(error) if (!didRequest.current) { - // logout() + logout() } } finally { setShowSplashScreen(false) -- 2.34.1