feat(auth): render terminal modal on 410 Gone (ACCOUNT_DELETED) and force logout #411
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!411
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-348-terminal-modal-on-account-deleted"
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?
Companion to mokosh-server's MAPPS-348 change (feat/MAPPS-348-410-gone-account-deleted): now that every auth extractor returns 410 Gone with
code: ACCOUNT_DELETEDonce a bunyip account has been deleted (via the PMS-591 webhook that stampsusers.deleted_at), the SPA can distinguish that terminal state from a generic 401 (session expired, please refresh) and render the "your account has been deleted" flow instead of degrading to the shared "server unreachable" banner + demo rows that the /tickets screenshot showed on staging.ACCOUNT_DELETEDGlobalSignal<bool>inhooks::fetch. Flipped to true (once, one-way) bynote_account_deleted()the moment ANY fetch (get_authed,post_authed, etc. and the_typedvariants) sees a 410 +error.code == "ACCOUNT_DELETED". Idempotent: only writes to the signal on the transition, so a burst of concurrent 410s does not wake readers repeatedly.status_errorfor theString-error helpers andhandle_responsefor the typedApiErrorhelpers). Every existing call site inherits the detection without needing changes; the terminal state is a global fact, not a per-request one.AccountDeletedOverlaycomponent. Renders nothing while the signal is false (zero DOM on a healthy session). On the transition it covers the entire viewport with a non-dismissible modal reading "Your account has been deleted. Signing you out in N seconds...", clears the local OIDC token holder on mount (belt + braces so a subsequent request cannot re-arm the tombstoned bearer), counts down 5 seconds, and hard-navigates to bunyip's/v1/auth/logout?url=<msp origin root>- the same URL pattern the existingUserMenuuses for a user-initiated logout so bunyip clears the shared.a8n.systemscookies and 302s back to the SPA origin root signed out. A "Sign out now" button jumps to the same target immediately.AppLayoutroot, next toToastRoot, so every route inherits it.Rollout order: server-first. If this SPA lands before the mokosh-server 410 companion, no regression - the terminal signal never flips because no fetch ever sees an ACCOUNT_DELETED body, so the overlay stays dark and the SPA behaves exactly as it does today.
#MAPPS-348