veza/apps/web/src/components/auth
senke a90b584e53 fix(security): protect admin routes with role check
Previously, any authenticated user could access /admin, /admin/moderation,
/admin/platform, /admin/transfers, and /admin/roles — the ProtectedRoute
only checked isAuthenticated, not role. Exposed the admin Command Center
UI to listeners/creators (critical security flaw).

Changes:
- ProtectedRoute accepts requireAdmin prop; redirects to /dashboard when
  authenticated user lacks admin/super_admin role or is_admin=true
- New wrapAdminProtected() helper in routeConfig
- All /admin/* routes now use wrapAdminProtected

Note: Backend API still enforces admin checks independently — this fix
only prevents the UI from being shown to non-admins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 16:19:16 +02:00
..
ProtectedRoute.test.tsx chore(refactor/sumi-migration): commit pending changes — tests, stream server, dist_verification 2026-02-13 19:39:18 +01:00
ProtectedRoute.tsx fix(security): protect admin routes with role check 2026-04-05 16:19:16 +02:00