Skip to content

test(platform): close out the auth/2FA/SSO gaps of #2085 with regression cover - #2526

Merged
yannickmonney merged 4 commits into
mainfrom
fix/auth-sso-gaps-2085
Jul 6, 2026
Merged

yannickmonney merged 4 commits into
mainfrom
fix/auth-sso-gaps-2085

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Summary

Closes #2085.

All six code fixes enumerated in #2085 already landed on main via #2118 and its follow-ups (6ecb7c7, c1ac556, 4c85d2f, a5ac8ab) — I verified each site against the current code. What was missing to close the issue out safely was regression cover: only [12] and [13] were pinned by tests. This PR adds the missing regression tests (happy path + the guarded edge per item) so none of the fixed behaviours can silently regress, and re-verifies the two already-pinned items.

Item map

Item Fix (already on main) Regression cover
[04] /2fa-enroll wall traps non-blocked users app/routes/2fa-enroll.tsx already-enrolled bounce (4c85d2f, scoped by a5ac8ab) Added app/features/auth/two-factor-enroll-guard.test.tsx (30c10cb): bounce + redirectTo, stays for un-enrolled, never interrupts mid-enrollment
[05] banners use assertive role="alert" both banners ship role="status" (c1ac556) Added two-factor-grace-banner.test.tsx + two-factor-low-backup-codes-banner.test.tsx (affdd08): polite status role, no alert, hide conditions
[06] dead endsWith('forced-change-password') guard use-password-expiry-gate.ts inclusion match (c1ac556) Added use-password-expiry-gate.test.ts (b32cf23): short-circuit on the real /forced-change-password/<id> shape, redirect when expired, no-op otherwise
[12] inert "auto-assign roles from the IdP" toggle RoleMappingRulesEditor in the SSO form (4c85d2f) Already pinned: enterprise-sso-form.test.tsx "adds a role-mapping rule and saves it (#2085[12])" — re-run green
[13] SCIM Group PATCH clear-all drops adds composition in scim/internal_mutations.ts (6ecb7c7) Already pinned: scim/provisioning_logic.test.ts (#2085[13]) — re-run green
[19] enforced-2FA disable has no warning disableEnforcedWarning in the disable dialog (4c85d2f) Added two-factor-section.test.tsx (385aafc): warning when enforced, none otherwise, warn-not-block

Each new test was watched fail against the pre-fix code (guard/role/match/warning reverted locally) and pass against the current code. Only production-code change: TwoFactorEnrollPage is now exported from the route file for the test, mirroring LogInPage.

Tests

  • bunx vitest --run --config vitest.ui.config.ts on the five new files + enterprise-sso-form.test.tsx → 6 files, 31 tests passing
  • bunx vitest --run --project server convex/scim/ → 3 files, 54 tests passing
  • bunx tsc --noEmit (platform) clean
  • bunx oxlint --type-aware on changed files → 0 warnings, 0 errors
  • oxfmt --check clean; opengrep SAST on changed files → 0 findings

No new user-visible strings (no locale changes needed).

The /2fa-enroll wall's guard (#2085 [04]) had no regression test: it must
bounce an already-enrolled user (honouring redirectTo), keep a
not-yet-enrolled user on the wall, and never interrupt an in-progress
enrollment after verifyTotp flips twoFactorEnabled. Exports
TwoFactorEnrollPage from the route file for the test, mirroring LogInPage.

Refs #2085
The grace and low-backup-codes banners are persistent dashboard chrome and
must expose role="status" (implicit aria-live polite), never the assertive
role="alert" they originally shipped with (#2085 [05]). Also pins the
hide conditions (decision !== 'grace' / healthy backup-code pool).

Refs #2085
The forced-change-password route is /forced-change-password/$id, so the
pathname ends with the org id — the gate's original
endsWith('forced-change-password') never matched and kept re-navigating to
the page the user was already on (#2085 [06]). Pins the inclusion match,
the redirect on an expired credential, and the not-expired no-op.

Refs #2085
Disabling 2FA from the Account page must show a standing warning in the
password dialog when the org enforces 2FA, show none otherwise, and still
let the disable proceed — warn, not block (#2085 [19]).

Refs #2085
@yannickmonney
yannickmonney merged commit ef10e70 into main Jul 6, 2026
14 of 16 checks passed
@yannickmonney
yannickmonney deleted the fix/auth-sso-gaps-2085 branch July 6, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant