Skip to content

Conversation

@wangsijie
Copy link
Contributor

Summary

Add account center and MFA feature validation to BackupCodeView page, consistent with other MFA pages.

Previously, when backup code feature was disabled in sign-in experience MFA settings, the BackupCodeView page would still render normally instead of showing an error page. This was inconsistent with other MFA pages like PasskeyView, TotpBinding, and BackupCodeBinding which all check if their respective MFA feature is enabled.

Changes

  • Import AccountCenterControlValue and Mfa type from @logto/schemas
  • Add isBackupCodeEnabled helper function
  • Get accountCenterSettings and experienceSettings from PageContext
  • Add validation checks before rendering:
    • Check if account center is enabled and MFA field is editable
    • Check if backup code is enabled in experienceSettings.mfa

Testing

  • TypeScript compilation passes
  • ESLint passes

Add account center and MFA feature validation to BackupCodeView,
consistent with other MFA pages like PasskeyView, TotpBinding, etc.
@github-actions
Copy link

COMPARE TO master

Total Size Diff 📈 +644 Bytes

Diff by File
Name Diff
packages/account/src/pages/BackupCodeView/index.tsx 📈 +644 Bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants