From 84d42132ada1ab49a73e963b366f75ce669fc9b3 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 00:34:50 +0100 Subject: [PATCH] fix: remove invalid lowercase employee role comparisons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove invalid comparisons against lowercase 'employee' role that don't exist in the User type. The role type only includes uppercase 'EMPLOYEE'. Fixed in: - app/employe/dashboard/page.tsx (lines 42, 117) - app/employe/layout.tsx (lines 28, 48) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/employe/dashboard/page.tsx | 4 ++-- app/employe/layout.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; }