diff --git a/app/employe/dashboard/page.tsx b/app/employe/dashboard/page.tsx index a8c1f02..db9526c 100644 --- a/app/employe/dashboard/page.tsx +++ b/app/employe/dashboard/page.tsx @@ -39,7 +39,7 @@ export default function EmployeDashboardPage() { return; } - if (isAuthenticated && user?.role !== 'EMPLOYEE' && user?.role !== 'employee') { + if (isAuthenticated && user?.role !== 'EMPLOYEE') { router.push(ROUTES.HOME); toast.error('Accès refusé : rôle employé requis'); return; @@ -114,7 +114,7 @@ export default function EmployeDashboardPage() { ); } - if (!isAuthenticated || (user?.role !== 'EMPLOYEE' && user?.role !== 'employee')) { + if (!isAuthenticated || user?.role !== 'EMPLOYEE') { return null; } diff --git a/app/employe/layout.tsx b/app/employe/layout.tsx index c56be6f..052fff9 100644 --- a/app/employe/layout.tsx +++ b/app/employe/layout.tsx @@ -25,7 +25,7 @@ export default function EmployeLayout({ return; } - if (isAuthenticated && user?.role !== "EMPLOYEE" && user?.role !== "employee") { + if (isAuthenticated && user?.role !== "EMPLOYEE") { router.push("/"); toast.error("Accès refusé : rôle employé requis"); return; @@ -45,7 +45,7 @@ export default function EmployeLayout({ ); } - if (!isAuthenticated || (user?.role !== "EMPLOYEE" && user?.role !== "employee")) { + if (!isAuthenticated || user?.role !== "EMPLOYEE") { return null; }