logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.66k stars 439 forks source link

refactor(core): refactor backup code generates flow #6339

Closed simeng-li closed 3 months ago

simeng-li commented 3 months ago

Summary

Refactor backup code generates flow. Align with TOTP and WebAuthn. Use verification record as the single source of truth for new generated backup codes.

All the MFAs should be bound by a MfaVerificationRecord.

@wangsijie

Testing

integration test updated

Checklist

github-actions[bot] commented 3 months ago

COMPARE TO master

Total Size Diff :chart_with_downwards_trend: -1.04 KB

Diff by File |Name|Diff| |---|---| |packages/core/src/routes/experience/classes/mfa.ts|:chart_with_downwards_trend: -1.09 KB| |packages/core/src/routes/experience/classes/verifications/backup-code-verification.ts|:chart_with_downwards_trend: -616 Bytes| |packages/core/src/routes/experience/classes/verifications/verification-record.ts|:chart_with_downwards_trend: -120 Bytes| |packages/core/src/routes/experience/profile-routes.ts|:chart_with_downwards_trend: -1.54 KB| |packages/core/src/routes/experience/verification-routes/backup-code-verification.ts|:chart_with_downwards_trend: -894 Bytes|