update user_id 12

This commit is contained in:
Mohamed Nouffer
2023-07-26 18:47:25 +05:30
parent efd4d9bf58
commit c8a306f022
8 changed files with 36 additions and 38 deletions

View File

@ -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>
);
}