This commit was merged in pull request #5.
This commit is contained in:
2023-04-14 14:12:29 -07:00
parent d3d08f9892
commit 3ef37b0b9e
+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)