diff --git a/src/components/auth/PermissionRoute.tsx b/src/components/auth/PermissionRoute.tsx index 5b9454b..97c35d8 100644 --- a/src/components/auth/PermissionRoute.tsx +++ b/src/components/auth/PermissionRoute.tsx @@ -58,7 +58,11 @@ export function PermissionRoute({ } if (!hasAccess) { - return ; + // Redirect back to the admin landing — unless we're already there + // (would loop) or the landing itself is what we lack permission for. + // Fall back to the user dashboard in that case. + const target = location.pathname === '/admin' ? '/' : '/admin'; + return ; } }