From e422f13beddc7f572726c87f987ffc20e0cfa661 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 00:25:05 +0100 Subject: [PATCH] fix: remove invalid role comparisons in admin page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove lowercase 'admin' role checks that don't exist in the User type. The role type is 'CLIENT' | 'EMPLOYEE' | 'ADMIN', so comparing against lowercase 'admin' causes TypeScript compilation errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/admin/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 32605aa..5a63932 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -15,14 +15,14 @@ export default function AdminPage() { return; } - if (isAuthenticated && user?.role !== "ADMIN" && user?.role !== "admin") { + if (isAuthenticated && user?.role !== "ADMIN") { router.push("/"); toast.error("Accès refusé : rôle administrateur requis"); return; } // Redirect to dashboard - if (isAuthenticated && (user?.role === "ADMIN" || user?.role === "admin")) { + if (isAuthenticated && user?.role === "ADMIN") { router.push("/admin/dashboard"); return; }