fix(GRO-2358): wire signOut() at higher layer for no-access screen #72
Reference in New Issue
Block a user
Delete Branch "feature/2357-p1-logout-on-no-access"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes GRO-2358 — P1 restoration of logout on the "Portal access not configured" screen.
The "Portal access not configured" card (rendered when an Authentik SSO user has no matching client row) used an inline
fetch("/api/auth/sign-out", ...)rather than the sharedsignOut()exported bylib/auth-client.AdminLayoutalready uses the shared handler, so the no-access screen was a divergence that could trap a user on an authenticated surface with a broken exit.Changes
src/portal/CustomerPortal.tsx— Add a stablehandleSignOutcallback that calls the canonicalsignOut()fromlib/auth-clientand always navigates to/login(even on transient auth-server failure). Use it from the no-access card's "Sign out" button. The handler is the SAME functionAdminLayoutuses, so the "same logout handler reachable from any authenticated route" AC is satisfied without adding a new chrome element.src/__tests__/portal.test.tsx— Two new tests:calls the shared signOut() handler and navigates to /login from the no-access screen (GRO-2358)— drives the no-access card from/and verifies the sharedsignOutspy fires once plus a/loginnavigation.reaches the same shared signOut() on a deep-link no-access screen (GRO-2358)— repeats the assertion from/appointmentsso a stale or deep link into a portal the user has no access to also reaches the escape hatch.UAT_PLAYBOOK.md§5.25.6 updated to document the shared-handler invariant; new §5.25.6b covers the deep-link case.Acceptance criteria
/login./appointmentsno-access test;AdminLayoutadmin chrome uses the same exportedsignOut).Verification
pnpm test— 183/183 pass (22/22 inportal.test.tsx).pnpm typecheck— clean.pnpm lint— clean (3 pre-existing warnings, no new ones).