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