From 3f0b421bbabc52aff53806bbb23b32e5095bf0a0 Mon Sep 17 00:00:00 2001
From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it>
Date: Thu, 27 May 2021 15:09:52 +0200
Subject: [PATCH] Change rendering condition and Cleanup.

---
 src/components/Authorization/Authorization.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/components/Authorization/Authorization.tsx b/src/components/Authorization/Authorization.tsx
index cfe2ea8..6645687 100644
--- a/src/components/Authorization/Authorization.tsx
+++ b/src/components/Authorization/Authorization.tsx
@@ -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 ? (
-- 
GitLab