From 47799990e38f3ca81c23fedca7b6b78ef09d07a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Wed, 18 Mar 2026 09:32:21 -0300 Subject: [PATCH] fix: auto-redirect super admins to the super admin panel from root - Updated AuthGuard to intercept navigation to the standard dashboard ('/') for users with the 'super_admin' role and automatically redirect them to '/super-admin'. --- App.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/App.tsx b/App.tsx index 5f74772..0b7479e 100644 --- a/App.tsx +++ b/App.tsx @@ -76,6 +76,11 @@ const AuthGuard: React.FC<{ children: React.ReactNode, roles?: string[] }> = ({ return ; } + // Auto-redirect Super Admins away from the standard dashboard to their specific panel + if (location.pathname === '/' && user.role === 'super_admin') { + return ; + } + return {children}; };