Persona switch should land on the new persona's role-home, not refresh the current URL (kills access-denied false positives)
handleSwitchPersona (src/components/app-sidebar.tsx:204) does: await switchPersona(personaId); onNavigate?.(); router.refresh(). router.refresh() re-renders the CURRENT URL under the new persona — so switching to a lower-scope persona (e.g. alumno) while on a docente/admin page (/alumnos/[id]) strands the user there and the authz gate correctly bounces to /acceso-denegado = a false-positive access-denied (confirmed live 2026-07-05, Elazar's alumno persona on Matias Wang's /alumnos/[id]). FIX: after a SUCCESSFUL switchPersona, navigate to '/' instead of router.refresh() — '/' is the role-aware home redirector (app/page.tsx -> resolveHomeRoute in navigation.ts:21) that sends each identity to its default landing. Mirrors the existing view-as flow (view-as-button.tsx 'lands on / (their role-aware home)'). Apply for BOTH personaId=null (back to real account) and a persona id. switchPersona returns ActionResult{success,error}; only redirect on success and surface the error otherwise (today errors are silently swallowed — minor guard, worth adding). No authz-gate change, no schema, no DB — pure client-nav fix. ACCEPTANCE: switching persona from any page lands on the new persona's role-home (e.g. alumno -> /mi-cursada), never the previous URL, so no access-denied false positive fires. Complements PLUTO-514 (which down-tiers any residual access-denied off the pager).
Questions
Activity
-
Persona switch redirects to role-home (router.push('/')) instead of refresh-in-place. 5394e44/v2.3.22, audit PASS (dpl_Dbn5pE prod-aliased, live=2.3.22, runtime clean). Kills the access-denied false positive at source. Live persona-switch functional confirm = Elazar's click.