Browse Source

invalid auth permiss cookie

amenpunk 2 years ago
parent
commit
17a6f25a8f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Components/PrivateRoute.js

+ 1 - 1
src/Components/PrivateRoute.js

@@ -6,7 +6,7 @@ export default function RequireAuth({ children }) {
6 6
     let auth = useAuth();
7 7
     let location = useLocation();
8 8
     let { authorities } = auth.getRole();
9
-    authorities = authorities.map( e => e.toUpperCase());
9
+    authorities = authorities ? authorities.map( e => e.toUpperCase()) : [] ;
10 10
 
11 11
     if (!auth.isLogged()) {
12 12
         if( authorities.includes("CANDIDATO")){