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.15k stars 395 forks source link

feat(core,schemas): implement backup codes verification #6207

Closed simeng-li closed 1 month ago

simeng-li commented 1 month ago

Summary

This PR implement the BackupCode verification type, includes:

  1. BackupCodeVerification class
  2. /experience/verification/backup-code/verify endpoint

Testing

integration tests added

Checklist

github-actions[bot] commented 1 month ago

COMPARE TO master

Total Size Diff :chart_with_upwards_trend: +9.85 KB

Diff by File |Name|Diff| |---|---| |packages/core/src/routes/experience/classes/experience-interaction.ts|:chart_with_upwards_trend: +40 Bytes| |packages/core/src/routes/experience/classes/verifications/backup-code-verification.ts|:chart_with_upwards_trend: +3.34 KB| |packages/core/src/routes/experience/classes/verifications/index.ts|:chart_with_upwards_trend: +375 Bytes| |packages/core/src/routes/experience/index.ts|:chart_with_upwards_trend: +142 Bytes| |packages/core/src/routes/experience/verification-routes/backup-code-verification.ts|:chart_with_upwards_trend: +1.76 KB| |packages/integration-tests/src/client/experience/index.ts|:chart_with_upwards_trend: +278 Bytes| |packages/integration-tests/src/helpers/experience/index.ts|:chart_with_upwards_trend: +831 Bytes| |packages/integration-tests/src/tests/api/experience-api/verifications/backup-code-verification.test.ts|:chart_with_upwards_trend: +3.28 KB| |packages/integration-tests/src/tests/api/experience-api/verifications/totp-verification.test.ts|:chart_with_upwards_trend: +386 Bytes| |packages/schemas/src/types/interactions.ts|:chart_with_upwards_trend: +306 Bytes|