feat(auth): remediation overlay for the ADR-0069 session gate (enforced MFA / password expiry)#2037
Merged
Merged
Conversation
The backend blocks logged-in users from protected resources with
403 { error: { code: MFA_REQUIRED | PASSWORD_EXPIRED } }. The Console now
detects this on every API response and guides the user through the fix instead
of leaving them on failing requests.
- auth: createAuthenticatedFetch detects the gate (403 + code) and broadcasts it
via a module-level emitter (auth-gate-events); AuthProvider exposes
remediationRequired + setRemediationRequired and subscribes; the twoFactorClient
plugin is enabled and enrollTotp/verifyTotp added to the auth client.
- app-shell: RemediationOverlay (mounted in ConsoleShell, above all routes)
renders the guided flow — expired-password change, or TOTP enrollment
(password -> QR + backup codes -> verify) — then reloads so the app re-fetches.
Browser-verified end-to-end against a backend with mfa_required: un-enrolled
user's data calls 403 -> overlay -> enroll -> verify a real TOTP -> gate clears
-> app loads. Auth tests 122 pass; auth + app-shell build (tsc) green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Console-side remediation flow for the ADR-0069 authentication session gate. The ObjectStack backend now returns
403 { error: { code: 'MFA_REQUIRED' | 'PASSWORD_EXPIRED' } }from protected endpoints when a logged-in user must enrol an authenticator or change an expired password (framework PRs objectstack-ai/objectstack#2388, #2390). Without this, flippingmfa_requiredon just shows the user failing requests — this PR makes it usable.What
@object-ui/authcreateAuthenticatedFetchdetects the gate (403 + recognised code) on every API response and broadcasts it via a tiny module-level emitter (auth-gate-events.ts).AuthProviderexposesremediationRequired+setRemediationRequiredand subscribes to the emitter.twoFactorClientplugin is enabled;enrollTotp(password)/verifyTotp(code)are added to the auth client (mirrors the existingchangePasswordcast pattern).@object-ui/app-shellRemediationOverlay(mounted inConsoleShell, above all routes) renders the guided flow:PASSWORD_EXPIRED→ change-password form.MFA_REQUIRED→ confirm password → QR (rendered client-side viaqrcode) + backup codes → verify a 6-digit TOTP.Auth, metadata and
me/*reads stay reachable (server allow-list), so the overlay renders above a normally-loading shell — it never has to block itself from rendering.Verification
@object-ui/auth122 tests pass;@object-ui/auth+@object-ui/app-shellbuild (tsc) green; lint 0 errors.mfa_requiredon, grace 0):403 MFA_REQUIRED→ full-screen overlay appears (auth/meta/mecalls stay200)./two-factor/enable→ real QR + backup codes render./two-factor/verify-totp→ gate clears → reload → the app loads fully (data table renders).Screenshots of all three steps were captured during verification.
Notes
require_mfa, the dispatcher/MCP gate path.🤖 Generated with Claude Code