fleet login implementation #5

Merged
ameye merged 1 commits from login-implementation into master 2023-04-15 19:57:47 +00:00
+7 -4
View File
@@ -69,15 +69,18 @@ const AuthInit: FC<WithChildren> = ({children}) => {
const requestUser = async (apiToken: string) => { const requestUser = async (apiToken: string) => {
try { try {
if (!didRequest.current) { if (!didRequest.current) {
const {data} = await getUserByToken(apiToken) // const {data} = await getUserByToken(apiToken)
if (data) { // if (data) {
setCurrentUser(data) // setCurrentUser(data)
// }
if(localStorage.getItem('kt-auth-react-v')){
setCurrentUser(auth?.profile)
} }
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)
if (!didRequest.current) { if (!didRequest.current) {
// logout() logout()
} }
} finally { } finally {
setShowSplashScreen(false) setShowSplashScreen(false)