update user_id 12
This commit is contained in:
@ -35,11 +35,11 @@ const TheContent = () => {
|
||||
console.log(result.data);
|
||||
setSsoSession(result.data);
|
||||
}
|
||||
get_token_from_storage_or_cookie();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchSession()
|
||||
//get_token_from_storage_or_cookie();
|
||||
}, []);
|
||||
|
||||
async function postUserData(data) {
|
||||
@ -156,30 +156,28 @@ const TheContent = () => {
|
||||
|
||||
return (
|
||||
<main className="c-main">
|
||||
<CContainer fluid>
|
||||
<Suspense fallback={loading}>
|
||||
<Switch>
|
||||
{routes.map((route, idx) => {
|
||||
return route.component && (
|
||||
<Route
|
||||
key={idx}
|
||||
path={route.path}
|
||||
exact={route.exact}
|
||||
name={route.name}
|
||||
render={(props) =>
|
||||
get_token_from_storage_or_cookie() !== null || isDataFetched == true ? (
|
||||
{isDataFetched ? ( // Render the component only when isDataFetched is true
|
||||
<CContainer fluid>
|
||||
<Suspense fallback={loading}>
|
||||
<Switch>
|
||||
{routes.map((route, idx) => {
|
||||
return route.component && (
|
||||
<Route
|
||||
key={idx}
|
||||
path={route.path}
|
||||
exact={route.exact}
|
||||
name={route.name}
|
||||
render={(props) =>
|
||||
<route.component {...props} userid={UserId} email={UserData.email} />
|
||||
) : (
|
||||
<Redirect to={{ pathname: "/sso" }} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
<Redirect from="/" to="/dashboard" />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</CContainer>
|
||||
}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
<Redirect from="/" to="/dashboard" />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</CContainer>
|
||||
) : null}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user