Skip to content

release: to prod#1395

Merged
eskp merged 3 commits into
prodfrom
staging
May 28, 2026
Merged

release: to prod#1395
eskp merged 3 commits into
prodfrom
staging

Conversation

@eskp

@eskp eskp commented May 28, 2026

Copy link
Copy Markdown

Summary

Promote the following merged PRs from staging to prod:

Post-deploy verification

  • deploy-keeperhub workflow finishes green
  • curl -fsS https://app.keeperhub.com/api/health returns 200
  • Smoke-test the surfaces affected by the merged PRs above
  • Watch Sentry / logs for ~10 minutes after the rollout

eskp and others added 3 commits May 28, 2026 19:07
requireDualFactor called auth.api.verifyTOTP, which requires either an
active Better Auth session or the TWO_FACTOR_COOKIE_NAME cookie. The
OAuth-MFA finalize path runs after interceptOauthCallback has
destroyed the session and leaves only the pending_oauth_mfa cookie, so
verifyTOTP threw for every request and every OAuth-with-TOTP sign-in
failed with "Invalid authenticator code" regardless of the code
submitted. Live in prod since 2026-05-26 22:17 UTC (KEEP-619 PR #1355).

Replace the verifyTOTP call with a direct read of two_factor.secret
plus verifyUserTotp() — the same session-less primitive that
strict-signin already uses in production. Same RFC 6238 window, same
constant-time compare, no behavior change for the 15 callers that
already have a session.

Test: tests/unit/dual-factor.test.ts covers the regression case
(valid TOTP + email OTP without a session ⇒ ok=true) plus
mfa_code_invalid on wrong code, mfa_code_invalid on missing two_factor
row (don't leak enrollment state), email_code_invalid on missing
verifications row, and factors_required on missing codes.

Refs KEEP-619.
Three small follow-ups from the multi-agent review on PR #1394:

- Refresh the requireDualFactor docstring; it still claimed TOTP was
  verified via Better Auth's verifyTOTP endpoint after the fix moved
  that off to verifyUserTotp.
- Assert resetDualFactor is called on the happy path. Without this,
  the rate-limit counter could silently stop clearing on success and
  the suite would still go green.
- The "no two_factor row" test was passing a live TOTP code that was
  never reached; replace with "000000" so the test name and the input
  match what is actually being asserted.
…sion-less

fix(auth): verify TOTP session-lessly in dual-factor gate
@eskp eskp merged commit 8806e1a into prod May 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant