Skip to content

feat(meta): expose per-method MFA availability for the login UI#681

Merged
lakhansamani merged 2 commits into
mainfrom
feat/meta-mfa-methods
Jul 12, 2026
Merged

feat(meta): expose per-method MFA availability for the login UI#681
lakhansamani merged 2 commits into
mainfrom
feat/meta-mfa-methods

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Adds four booleans to the public meta query so the hosted login UI (authorizer-react's new AuthorizerMFASetup) shows only the MFA methods the instance actually supports.

  • is_totp_mfa_enabled = EnableMFA && EnableTOTPLogin
  • is_email_otp_mfa_enabled = EnableMFA && EnableEmailOTP && IsEmailServiceEnabled
  • is_sms_otp_mfa_enabled = EnableMFA && EnableSMSOTP && IsSMSServiceEnabled
  • is_webauthn_enabled = true (WebAuthn/passkey shipped always-on in feat(webauthn): add passkey registration and login support #671; confirmed no disable flag exists)

Derivations mirror the per-method gating in login.go and the aggregate isMFAServiceAvailable() from #679. Added to type Meta (GraphQL) + Meta proto (fields 22-25, additive) + the gRPC handler mapping; populated on the PUBLIC meta (not AdminMeta).

Maps 1:1 onto authorizer-react's availableMfaMethods prop ({ totp, passkey, emailOtp, smsOtp }), so the login app can drive the MFA-setup hub straight from meta.

Testing

TestMeta extended (default → totp/email/sms false, webauthn true; MFA+TOTP → totp true; email/SMS gated on service). Full sqlite integration suite green; build/vet/golangci-lint/codegen parity clean. Makefile untouched.

- add is_totp_mfa_enabled, is_email_otp_mfa_enabled, is_sms_otp_mfa_enabled,
  is_webauthn_enabled to the public Meta type (GraphQL + proto)
- derive OTP/TOTP flags with the same per-method gating login enforces;
  webauthn is always-on (no operator flag)
- lets the hosted login app render only the MFA methods the instance supports
@lakhansamani lakhansamani merged commit 251c83c into main Jul 12, 2026
@lakhansamani lakhansamani deleted the feat/meta-mfa-methods branch July 12, 2026 06:41
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