BillTracker/routes
null 2a07e762a2 fix: four review-confirmed regressions in auth + OIDC flows
All found by the multi-angle /code-review over the branch and verified
against the installed libraries:

- 401 discriminator: the session-expiry redirect keyed off a path prefix
  (!/auth/*) and falsely logged users out on /profile/change-password
  with a wrong current password. requireAuth's no-session 401 now carries
  the distinct AUTH_REQUIRED code — the only signal api.ts dispatches
  auth:expired on; wrong-credential 401s keep AUTH_ERROR on any path.
  Test updated to pin the code-based contract on both directions.
- OIDC RFC 9207: exchangeAndVerifyTokens rebuilt the callback URL with
  only code+state, dropping the iss parameter openid-client v6 validates
  when the provider advertises support (authentik does) — every OIDC
  login would fail post-upgrade. The full callback query is now forwarded.
- OIDC http issuers: v6 enforces HTTPS on discovery/endpoints (v5
  didn't) — breaking internal http:// providers on Docker networks.
  OIDC_ALLOW_INSECURE_HTTP=true opts back in (documented in .env.example).
- 2FA downgrade: authService's webauthn fallback caught ANY challenge
  error and silently downgraded to password-only login; now only the
  stale-flag 'No registered WebAuthn credentials' case falls through,
  everything else rethrows.
- Burned-challenge retry: the server consumes the single-use 2FA
  challenge before verifying (anti-replay), so after a server rejection
  a retry can only ever return 'Challenge expired'. LoginPage now resets
  to sign-in on server failure (WebAuthn AND the pre-existing TOTP trap);
  a browser-prompt cancel keeps retry (token still live). Also lazy-loads
  @simplewebauthn/browser out of the entry bundle, matching ProfilePage.

Server 252/252, client 52/52, OIDC smoke 44/44, probe 33/33, e2e 27.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 22:57:07 -05:00
..
about.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
aboutAdmin.cts refactor(routes): throw-pattern for profile, transactions, admin, aboutAdmin 2026-07-10 17:18:28 -05:00
admin.cts chore(deps)!: vite 8 (rolldown) + @vitejs/plugin-react 6 (4h) 2026-07-10 17:53:27 -05:00
analytics.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
auth.cts feat(auth): passkey / security-key UI — WebAuthn ships end to end 2026-07-10 17:30:14 -05:00
authOidc.cts fix: four review-confirmed regressions in auth + OIDC flows 2026-07-10 22:57:07 -05:00
bills.cts refactor(routes): throw-pattern for bills.cts (largest route, 43+ sites) 2026-07-10 17:00:01 -05:00
calendar.cts refactor(routes/calendar): replace errorFormatter with ValidationError throws 2026-07-10 17:52:47 -05:00
calendarFeed.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
categories.cts refactor(categories): adopt Kysely for the /groups query (real production use) 2026-07-06 16:25:30 -05:00
dataSources.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
export.cts fix(standards): make the error-shape ratchet see require(); convert the 4 files it exposed 2026-07-10 17:53:24 -05:00
import.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
matches.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
monthly-starting-amounts.cts refactor(routes): monthly-starting-amounts → throw pattern; doc exemplar 2026-07-06 15:03:52 -05:00
notifications.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
payments.cts fix(standards): make the error-shape ratchet see require(); convert the 4 files it exposed 2026-07-10 17:53:24 -05:00
privacy.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
profile.cts refactor(routes): throw-pattern for profile, transactions, admin, aboutAdmin 2026-07-10 17:18:28 -05:00
settings.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
snowball.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
spending.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
status.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
subscriptions.cts refactor(routes): throw-pattern for payments + subscriptions 2026-07-10 16:53:20 -05:00
summary.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
tracker.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
transactions.cts refactor(routes): throw-pattern for profile, transactions, admin, aboutAdmin 2026-07-10 17:18:28 -05:00
user.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00
version.cts refactor(types): drop @ts-nocheck from the 9 smallest routes (Phase 6 starter) 2026-07-10 18:17:13 -05:00