♻️ MFA: send email code only when chosen, skip admin lockout outside prod - #140
Merged
Conversation
…ut outside prod Previously the email code was sent as soon as a login hit the MFA step, even when the user might pick TOTP instead — wasteful against Brevo's 300/day quota. Now it's only sent when email is the sole enabled method, or once the user actually picks "email" at the method-choice screen. Also skips the admin /admin MFA lockout (LK-C17) outside NODE_ENV=production — requiring TOTP/email setup just to reach the admin panel in dev/staging added friction with no real security benefit there. GET /api/config now exposes adminMfaEnforced so the web app's lockout screen matches what the API actually allows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Two follow-ups on the MFA feature (#139):
/adminMFA lockout (LK-C17) is now skipped outsideNODE_ENV=production—GET /api/configexposes a newadminMfaEnforcedflag so the web app's own lockout screen stays consistent with what the API actually allows.Test plan
pnpm build:packageapps/apitypecheck (tsc --noEmit) — cleanauth.service.spec.ts,admin.guard.spec.ts,public-config.controller.spec.ts)🤖 Generated with Claude Code