mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
PermissionRoute unconditionally sent permission-failing users to /admin. The current router wraps /admin in AdminRoute (no permission check), so this never triggered. But if /admin ever picks up a PermissionRoute guard — even by accident in a future change — the user would loop on itself with replace history (no back-button escape). Detect that case explicitly: if we're already on /admin and still failing the permission check, fall back to / instead. Costs nothing today, prevents a hard-to-diagnose lock-out later.