Skip to content

feat(console,schemas): add phone and email mfa factors #7580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

wangsijie
Copy link
Contributor

Summary

Add new MFA factors: Email and SMS. This PR implements Console configs.

截屏2025-07-23 上午9 30 24

Testing

Local tested.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 01:43
Copy link

github-actions bot commented Jul 23, 2025

COMPARE TO master

Total Size Diff ⚠️ 📈 +20.63 KB

Diff by File
Name Diff
packages/console/src/assets/icons/factor-email.svg 📈 +1.14 KB
packages/console/src/assets/icons/factor-phone.svg 📈 +1.57 KB
packages/console/src/components/MfaFactorName/index.tsx 📈 +136 Bytes
packages/console/src/components/MfaFactorTitle/index.tsx 📈 +230 Bytes
packages/console/src/pages/Mfa/MfaForm/FactorLabel/index.tsx 📈 +160 Bytes
packages/console/src/pages/Mfa/MfaForm/index.tsx 📈 +579 Bytes
packages/console/src/pages/Mfa/MfaForm/utils.ts 📈 +398 Bytes
packages/console/src/pages/Mfa/types.ts 📈 +82 Bytes
packages/core/src/libraries/user.utils.ts 📈 +188 Bytes
packages/core/src/routes/experience/profile-routes.ts 📈 +227 Bytes
packages/core/src/routes/interaction/actions/submit-interaction.ts 📈 +222 Bytes
packages/core/src/routes/interaction/verifications/mfa-payload-verification.ts 📈 +780 Bytes
packages/experience/src/apis/experience/mfa.ts 📈 +349 Bytes
packages/experience/src/assets/icons/factor-email.svg 📈 +1.14 KB
packages/experience/src/assets/icons/factor-phone.svg 📈 +1.57 KB
packages/experience/src/components/Button/MfaFactorButton.tsx 📈 +710 Bytes
packages/phrases-experience/src/locales/ar/mfa.ts 📈 +568 Bytes
packages/phrases-experience/src/locales/de/mfa.ts 📈 +470 Bytes
packages/phrases-experience/src/locales/en/mfa.ts 📈 +413 Bytes
packages/phrases-experience/src/locales/es/mfa.ts 📈 +505 Bytes
packages/phrases-experience/src/locales/fr/mfa.ts 📈 +472 Bytes
packages/phrases-experience/src/locales/it/mfa.ts 📈 +452 Bytes
packages/phrases-experience/src/locales/ja/mfa.ts 📈 +444 Bytes
packages/phrases-experience/src/locales/ko/mfa.ts 📈 +415 Bytes
packages/phrases-experience/src/locales/pl-pl/mfa.ts 📈 +436 Bytes
packages/phrases-experience/src/locales/pt-br/mfa.ts 📈 +469 Bytes
packages/phrases-experience/src/locales/pt-pt/mfa.ts 📈 +483 Bytes
packages/phrases-experience/src/locales/ru/mfa.ts 📈 +664 Bytes
packages/phrases-experience/src/locales/tr-tr/mfa.ts 📈 +430 Bytes
packages/phrases-experience/src/locales/uk-ua/mfa.ts 📈 +654 Bytes
packages/phrases-experience/src/locales/zh-cn/mfa.ts 📈 +426 Bytes
packages/phrases-experience/src/locales/zh-hk/mfa.ts 📈 +426 Bytes
packages/phrases-experience/src/locales/zh-tw/mfa.ts 📈 +426 Bytes
packages/phrases/src/locales/en/translation/admin-console/mfa.ts 📈 +323 Bytes
packages/schemas/src/foundations/jsonb-types/sign-in-experience.ts 📈 +102 Bytes
packages/schemas/src/foundations/jsonb-types/users.ts 📈 +633 Bytes
packages/schemas/src/types/interactions.ts 📈 +2.26 KB

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Email and SMS verification codes as new MFA (Multi-Factor Authentication) factors to the authentication system. The implementation includes schema definitions, payload guards for binding and verification, UI components, and localization support.

Key changes include:

  • Addition of EmailVerificationCode and PhoneVerificationCode to the MfaFactor enum
  • Creation of Zod validation schemas for binding, verification, and pending states for both new MFA factors
  • UI updates to display the new MFA options with feature flag protection
  • Localization strings for the new MFA factor names and descriptions

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/schemas/src/foundations/jsonb-types/sign-in-experience.ts Adds new MFA factor enum values for email and phone verification
packages/schemas/src/types/interactions.ts Defines Zod schemas and types for new MFA factors across bind, verify, and pending operations
packages/phrases/src/locales/en/translation/admin-console/mfa.ts Adds English localization strings for new MFA factor labels and descriptions
packages/console/src/pages/Mfa/types.ts Extends MFA form configuration type with new boolean flags for email/phone factors
packages/console/src/pages/Mfa/MfaForm/utils.ts Updates utility functions to handle conversion between MFA config and form data
packages/console/src/pages/Mfa/MfaForm/index.tsx Adds UI switches for new MFA factors with dev feature flag protection
packages/console/src/pages/Mfa/MfaForm/FactorLabel/index.tsx Maps new MFA factors to their description translation keys
packages/console/src/components/MfaFactorTitle/index.tsx Adds icon imports and mappings for new MFA factors
packages/console/src/components/MfaFactorName/index.tsx Maps new MFA factors to their name translation keys

@wangsijie wangsijie force-pushed the wangsijie-log-11828-setup-email-and-sms-factors branch from eb383be to 2fd725b Compare July 24, 2025 00:39
@github-actions github-actions bot added size/m and removed size/m labels Jul 24, 2025
@wangsijie wangsijie force-pushed the wangsijie-log-11828-setup-email-and-sms-factors branch from 2fd725b to 85f7a46 Compare July 24, 2025 02:09
@github-actions github-actions bot added size/l and removed size/m labels Jul 24, 2025
@wangsijie wangsijie force-pushed the wangsijie-log-11828-setup-email-and-sms-factors branch from 85f7a46 to d59655f Compare July 24, 2025 02:32
@wangsijie wangsijie requested a review from simeng-li as a code owner July 24, 2025 02:32
@github-actions github-actions bot added size/l and removed size/l labels Jul 24, 2025
@wangsijie wangsijie force-pushed the wangsijie-log-11828-setup-email-and-sms-factors branch from d59655f to ab96870 Compare July 24, 2025 02:45
@github-actions github-actions bot added size/l and removed size/l labels Jul 24, 2025
@wangsijie wangsijie force-pushed the wangsijie-log-11828-setup-email-and-sms-factors branch from ab96870 to b709d6d Compare July 28, 2025 02:33
@github-actions github-actions bot added size/l and removed size/l labels Jul 28, 2025
@wangsijie wangsijie merged commit 1ffc0e7 into master Jul 28, 2025
52 of 54 checks passed
@wangsijie wangsijie deleted the wangsijie-log-11828-setup-email-and-sms-factors branch July 28, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants