Skip to content
Snippets Groups Projects
Verified Commit 3f0b421b authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Change rendering condition and Cleanup.

parent 2c9b0662
No related branches found
No related tags found
3 merge requests!56Refined auth flow and new website pages.,!53Feature/authorization/curry,!52Change folder structure and fix auth flow.
This commit is part of merge request !53. Comments created here will be created in the context of that merge request.
...@@ -18,9 +18,7 @@ interface WithAuthProps { ...@@ -18,9 +18,7 @@ interface WithAuthProps {
allowedRoles: string[]; allowedRoles: string[];
} }
interface Props extends WithAuthProps { // FIX: Sometimes the login page is displayed the circle rather than the login page.
children: React.ReactNode;
}
/* eslint-disable react/jsx-props-no-spreading */ /* eslint-disable react/jsx-props-no-spreading */
/** /**
...@@ -42,7 +40,7 @@ export const withAuthorization = <T extends WithAuthProps = WithAuthProps>( ...@@ -42,7 +40,7 @@ export const withAuthorization = <T extends WithAuthProps = WithAuthProps>(
console.log(`ROLE ${role} AUTH ${isAuth}`); console.log(`ROLE ${role} AUTH ${isAuth}`);
/* eslint-disable no-nested-ternary */ /* eslint-disable no-nested-ternary */
return typeof isAuth === null || role === null ? ( return typeof isAuth === null && role === null ? (
<BlurCircular /> <BlurCircular />
) : // props comes afterwards so the can override the default ones. ) : // props comes afterwards so the can override the default ones.
allowedRoles.includes(role) && isAuth ? ( allowedRoles.includes(role) && isAuth ? (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment