Skip to content
Snippets Groups Projects

Feature/authorization/curry

Merged Defendi Alberto requested to merge feature/authorization/curry into dev
1 file
+ 2
4
Compare changes
  • Side-by-side
  • Inline
@@ -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 ? (
Loading