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
Branches
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 !52. Comments created here will be created in the context of that merge request.
......@@ -18,9 +18,7 @@ interface WithAuthProps {
allowedRoles: string[];
}
interface Props extends WithAuthProps {
children: React.ReactNode;
}
// FIX: Sometimes the login page is displayed the circle rather than the login page.
/* eslint-disable react/jsx-props-no-spreading */
/**
......@@ -42,7 +40,7 @@ export const withAuthorization = <T extends WithAuthProps = WithAuthProps>(
console.log(`ROLE ${role} AUTH ${isAuth}`);
/* eslint-disable no-nested-ternary */
return typeof isAuth === null || role === null ? (
return typeof isAuth === null && role === null ? (
<BlurCircular />
) : // props comes afterwards so the can override the default ones.
allowedRoles.includes(role) && isAuth ? (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment