浏览代码

invalid auth permiss cookie

amenpunk 3 年之前
父节点
当前提交
17a6f25a8f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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")){