Skip to content
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

feat(core,schemas): add secondary sign-up identifiers #7127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

simeng-li
Copy link
Contributor

@simeng-li simeng-li commented Mar 11, 2025

Summary

Enhance sign-up identifier settings to support additional identifiers.

Context

Previously, only one type of identifier could be collected during the sign-up process. The existing sign-up identifier settings in SIE included four options: username, email, phone, and emailOrPhone.
This update allows developers to require multiple identifiers for user sign-up, such as combinations like username + email, username + emailOrPhone, and username + email + phone.

Key updates (dev feature)

  • A new array-typed field, secondaryIdentifiers, has been introduced to the SIE signUp settings. All identifiers listed in this new field will be treated as additional required identifiers that users must provide during the sign-up process.
  • The existing signUp.identifiers field remains unchanged and will continue to be used as the primary sign-up identifier when rendering the sign-up form.
  • The secondaryIdentifiers will be validated after the primary sign-up identifiers are provided, ensuring a smooth transition for existing implementations.

Refactor sign-up and sign-in settings rules (changeset included)

We have fully decoupled the sign-up identifier settings from the sign-in methods. Developers can now require as many user identifiers as needed during the sign-up process without impacting the sign-in process.

The following restrictions on sign-in and sign-up settings have been removed:

  1. The password field in sign-up settings is no longer required when username is included as one of the sign-up identifiers (either primary or secondary). Developers may request a username without requiring a password during the sign-up process.

    Note: If username is the only sign-up identifier, users without a password will not be able to sign in. Developers or administrators should carefully configure the sign-up and sign-in settings to ensure a smooth user experience.

  2. The requirement that all sign-up identifiers must also be enabled as sign-in identifiers has been removed.

Testing

UT case updated

Checklist

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

Copy link

github-actions bot commented Mar 11, 2025

COMPARE TO master

Total Size Diff 📈 +4.95 KB

Diff by File
Name Diff
.changeset/purple-waves-sit.md 📈 +886 Bytes
packages/core/src/libraries/sign-in-experience/sign-in.test.ts 📈 +2.54 KB
packages/core/src/libraries/sign-in-experience/sign-in.ts 📈 +908 Bytes
packages/core/src/libraries/sign-in-experience/sign-up.test.ts 📈 +3.24 KB
packages/core/src/libraries/sign-in-experience/sign-up.ts 📈 +2.2 KB
packages/core/src/routes/sign-in-experience/index.ts 📈 +46 Bytes
packages/integration-tests/src/tests/api/sign-in-experience.test.ts 📈 +93 Bytes
packages/phrases/src/locales/en/errors/sign-in-experiences.ts 📈 +155 Bytes
packages/schemas/src/foundations/jsonb-types/sign-in-experience.ts 📈 +1.88 KB

@simeng-li simeng-li changed the title feat(core,schemas): add secondaryIdentifiers feat(core,schemas): add secondary sign-up identifiers Mar 11, 2025
Copy link
Contributor

@wangsijie wangsijie left a comment

Choose a reason for hiding this comment

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

Tests failed.

@simeng-li simeng-li force-pushed the simeng-log-10897-schemas-update-sie-schema-to-support-multiple-sign-up branch 2 times, most recently from dc24f72 to 427203c Compare March 13, 2025 06:36
@simeng-li simeng-li force-pushed the simeng-log-10897-schemas-update-sie-schema-to-support-multiple-sign-up branch from 427203c to 765188f Compare March 14, 2025 08:44
add secondaryIdentifiers to SIE signUp settings
@simeng-li simeng-li force-pushed the simeng-log-10897-schemas-update-sie-schema-to-support-multiple-sign-up branch from 765188f to c7a575b Compare March 14, 2025 09:10
add changeset
Copy link
Member

@gao-sun gao-sun left a comment

Choose a reason for hiding this comment

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

lgtm on changeset

"@logto/core": patch
---

remove some SIE sign-in and sign-up settings restrictions
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
remove some SIE sign-in and sign-up settings restrictions
remove multiple sign-in experience settings restrictions


remove some SIE sign-in and sign-up settings restrictions

For better customization flexibility, we have removed following restrictions on the SIE sign-in and sign-up settings:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For better customization flexibility, we have removed following restrictions on the SIE sign-in and sign-up settings:
For better customization flexibility, we have removed following restrictions in the sign-in experience "sign-in and sign-up" settings:

Comment on lines +11 to +12
Note: If username is the only sign-up identifier, users without a password will not be able to sign in. Developers or administrators should carefully configure the sign-up and sign-in settings to ensure a smooth user experience.
Users can still set password via [account API](https://docs.logto.io/end-user-flows/account-settings/by-account-api) after sign-up.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Note: If username is the only sign-up identifier, users without a password will not be able to sign in. Developers or administrators should carefully configure the sign-up and sign-in settings to ensure a smooth user experience.
Users can still set password via [account API](https://docs.logto.io/end-user-flows/account-settings/by-account-api) after sign-up.
Note: If username is the only sign-up identifier, users without a password will not be able to sign in. Developers or administrators should carefully configure the sign-up and sign-in settings to ensure a smooth user experience.
Users can still set password via [account API](https://docs.logto.io/end-user-flows/account-settings/by-account-api) after sign-up.

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