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
     let auth = useAuth();
6
     let auth = useAuth();
7
     let location = useLocation();
7
     let location = useLocation();
8
     let { authorities } = auth.getRole();
8
     let { authorities } = auth.getRole();
9
-    authorities = authorities.map( e => e.toUpperCase());
9
+    authorities = authorities ? authorities.map( e => e.toUpperCase()) : [] ;
10
 
10
 
11
     if (!auth.isLogged()) {
11
     if (!auth.isLogged()) {
12
         if( authorities.includes("CANDIDATO")){
12
         if( authorities.includes("CANDIDATO")){