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.69k stars 440 forks source link

refactor(core): make password optional in NewPasswordIdentity #6377

Closed simeng-li closed 3 months ago

simeng-li commented 3 months ago

Summary

Make password optional in NewPasswordIdentity verification endpoints. So users may pre-validate their identifier ahead without providing the password.

Issue: In our SIE design, the username + password registration flow is split into two forms. User will be asked to provide their username ahead. If the username is valid then jump to the password form. If the username is taken throws an error in the current page.

Updates: To better support that, we refactor the current NewPasswordIdentity verification endpoint, making the password field optional. So users may pre-validate their identifiers before specifying the password.

Testing

integration tests updated

Checklist

github-actions[bot] commented 3 months ago

COMPARE TO master

Total Size Diff :chart_with_downwards_trend: -315 Bytes

Diff by File |Name|Diff| |---|---| |packages/core/src/routes/experience/classes/experience-interaction.ts|:chart_with_downwards_trend: -96 Bytes| |packages/core/src/routes/experience/classes/libraries/sign-in-experience-validator.test.ts|:chart_with_downwards_trend: -2.49 KB| |packages/core/src/routes/experience/classes/libraries/sign-in-experience-validator.ts|:chart_with_downwards_trend: -475 Bytes| |packages/core/src/routes/experience/classes/verifications/new-password-identity-verification.ts|:chart_with_downwards_trend: -387 Bytes| |packages/core/src/routes/experience/verification-routes/new-password-identity-verification.ts|:chart_with_downwards_trend: -70 Bytes| |packages/integration-tests/src/client/experience/index.ts|:chart_with_downwards_trend: -52 Bytes| |packages/integration-tests/src/tests/api/experience-api/register-interaction/verification-code.test.ts|:chart_with_downwards_trend: -1.71 KB| |packages/integration-tests/src/tests/api/experience-api/verifications/new-password-identity-verification.test.ts|:chart_with_downwards_trend: -538 Bytes|