reset user_id gen

This commit is contained in:
Mohamed Nouffer
2023-07-26 17:22:07 +05:30
parent e9f0d85bbe
commit 51b5435201
9 changed files with 53 additions and 40 deletions

View File

@ -38,7 +38,6 @@ const TheContent = () => {
useEffect(() => {
fetchSession()
get_token_from_storage_or_cookie();
}, []);
async function postUserData(data) {
@ -154,33 +153,47 @@ const TheContent = () => {
}
return (
<main className="c-main">
<CContainer fluid>
<Suspense fallback={loading}>
<Switch>
{routes.map((route, idx) => {
<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 ? (
<route.component {...props} userid={UserId} email={UserData.email} />
) : (
<Redirect to={{ pathname: "/sso" }} />
)
<Route key = { idx }
path = { route.path }
exact = { route.exact }
name = { route.name }
// render = {
// props =>
// ( <route.component {...props} userid={1} email={"akira.miyata@mobilous.com"}/>
// )
// }
render = {
props =>
get_token_from_storage_or_cookie() !== null ?
( <route.component {...props} userid={UserId} email={UserData.email}/>
) : ( <Redirect to = {
{ pathname: "/sso" }
}
/>
)
}
/>
);
})}
<Redirect from="/" to="/dashboard" />
</Switch>
</Suspense>
</CContainer>
</main>
);
/>
)
})
}
<Redirect
from = "/"
to = "/dashboard" / >
</Switch> </Suspense >
</CContainer> </main >
)
}
export default React.memo(TheContent)