mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
fix: Refresh par profil role
This commit is contained in:
@ -18,7 +18,7 @@ const ProtectedRoute = ({ children, requiredRight }) => {
|
||||
hasRequiredRight,
|
||||
});
|
||||
|
||||
if (user && profileRole) {
|
||||
if (user && profileRole !== null) {
|
||||
let requiredRightChecked = false;
|
||||
if (requiredRight && Array.isArray(requiredRight)) {
|
||||
// Vérifier si l'utilisateur a le droit requis
|
||||
@ -41,7 +41,7 @@ const ProtectedRoute = ({ children, requiredRight }) => {
|
||||
// User non authentifié
|
||||
router.push(`${FE_USERS_LOGIN_URL}`);
|
||||
}
|
||||
}, [user]);
|
||||
}, [user, profileRole]);
|
||||
|
||||
// Autoriser l'affichage si authentifié et rôle correct
|
||||
return hasRequiredRight ? children : null;
|
||||
|
||||
Reference in New Issue
Block a user