fix: Correction des Protected Routes avec multi role

This commit is contained in:
Luc SORIGNET
2025-04-14 18:53:35 +02:00
parent 89b01b79db
commit dd0884bbce
3 changed files with 49 additions and 54 deletions

View File

@ -59,7 +59,6 @@ export default function Layout({
"settings": { "id": "settings", "name": t('settings'), "url": FE_ADMIN_SETTINGS_URL, "icon": Settings }
};
const [isLoading, setIsLoading] = useState(false);
const [isPopupVisible, setIsPopupVisible] = useState(false);
const pathname = usePathname();
@ -111,7 +110,7 @@ export default function Layout({
}, [pathname]);
return (
<ProtectedRoute requiredRight={RIGHTS.ADMIN}>
<ProtectedRoute requiredRight={[RIGHTS.ADMIN, RIGHTS.TEACHER]}>
<div className="flex min-h-screen bg-gray-50 relative">
{/* Retirer la condition !isLoading car on gère déjà le chargement au début */}
{/* Sidebar avec hauteur forcée */}