Skip to content

Comments

feat(experience): handle secondary sign-up identifiers#7142

Merged
simeng-li merged 6 commits intomasterfrom
simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic
Mar 24, 2025
Merged

feat(experience): handle secondary sign-up identifiers#7142
simeng-li merged 6 commits intomasterfrom
simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic

Conversation

@simeng-li
Copy link
Contributor

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

Summary

This PR enhances the experience app to support the newly introduced secondaryIdentifiers settings in the sign-up flow.

Key changes

  1. Preserved primary registration flow:
  • Maintained the existing first-page registration form rendering logic
  • Continues to use signUp.identifier as the primary sign-up method for the initial registration form
  1. Additional identifiers collection:
  • After initial registration form submission, users will be prompted to provide any additional required identifiers listed in the signUp.secondaryIdentifiers settings.
  • Account creation and interaction submission are gated behind the completion of all required identifiers
  1. Enhanced email/phone verification sign-in, account not exist error handling flow:
  • Updated the verification code sign-in flow for email and phone
  • Registration modal now appears when
    • The provided email/phone doesn't exist in Logto
    • Email/phone sign-up is enabled (either as a primary or secondary identifier)
    • User will be guided to provide other missing identifiers after the email/phone is submitted to complete the new account creation flow.

Other updates

  1. Username registration flow refactor
    This PR also includes significant updates to the username registration flow, aligning it with the recent changes in sign-in experience settings:
  • Previously, password setup was mandatory when username was set as a sign-up identifier. This restriction has been removed in the latest sign-in experience updates. See PR.
  • Dynamic password setup routing at the experience app side:
    • Previously: Users were automatically redirected to the password setup page after submitting the username registration form.
    • New Implementation: Added conditional routing logic based on SIE settings
      • If password is required: User is redirected to set password page
      • If password is not required: Interaction is submitted directly
    • This change ensures the registration flow aligns with the configured sign-up settings
  1. Revert the isDevFeaturesEnabled env variables reading logic update in PR
  • The experience app does not yet support ESM in unit tests. import.meta will throw an error.
  • Switch back to process.env till we migrate jest to vitest.

Testing

test locally

Checklist

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

@github-actions
Copy link

github-actions bot commented Mar 17, 2025

COMPARE TO master

Total Size Diff 📈 +4.98 KB

Diff by File
Name Diff
packages/experience/src/components/IdentifierRegisterForm/use-register-with-username.ts 📈 +1.15 KB
packages/experience/src/constants/env.ts 📈 +149 Bytes
packages/experience/src/containers/VerificationCode/use-register-flow-code-verification.ts 📈 +283 Bytes
packages/experience/src/containers/VerificationCode/use-sign-in-flow-code-verification.ts 📈 +44 Bytes
packages/experience/src/hooks/use-sie.ts 📈 +3.88 KB
packages/experience/src/pages/RegisterPassword/index.tsx 📈 +38 Bytes
packages/experience/src/pages/VerificationCode/index.tsx 📈 +75 Bytes
packages/experience/vite.config.ts 📈 +464 Bytes

@simeng-li simeng-li marked this pull request as draft March 17, 2025 03:45
@simeng-li simeng-li force-pushed the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch from 7525149 to 7d4b428 Compare March 17, 2025 07:27
@github-actions github-actions bot added size/m and removed size/s labels Mar 17, 2025
@simeng-li simeng-li force-pushed the simeng-log-10890-experience-api-update-registration-event-to-handle-multiple branch from dfe66bf to 759d3fd Compare March 18, 2025 02:35
@simeng-li simeng-li force-pushed the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch from 241003a to 7f85f16 Compare March 18, 2025 02:36
@simeng-li simeng-li marked this pull request as ready for review March 18, 2025 03:06
@simeng-li simeng-li requested review from a team, charIeszhao and wangsijie and removed request for a team March 18, 2025 03:06
@simeng-li simeng-li force-pushed the simeng-log-10890-experience-api-update-registration-event-to-handle-multiple branch from 759d3fd to 64aa695 Compare March 21, 2025 08:49
@simeng-li simeng-li requested a review from gao-sun as a code owner March 21, 2025 08:49
@simeng-li simeng-li force-pushed the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch from 7f85f16 to e26d414 Compare March 21, 2025 08:50
@simeng-li simeng-li force-pushed the simeng-log-10890-experience-api-update-registration-event-to-handle-multiple branch from 64aa695 to 0f7413c Compare March 24, 2025 02:22
@simeng-li simeng-li force-pushed the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch from e26d414 to 89a21e2 Compare March 24, 2025 02:22
Base automatically changed from simeng-log-10890-experience-api-update-registration-event-to-handle-multiple to master March 24, 2025 03:25
@github-actions github-actions bot added size/xl and removed size/m labels Mar 24, 2025
refactor the verification code sign-in and sign-up error handling logic.
remove verification code method assertion
add some comments
update username registraction handler, directly submit the interaction is password is not enabled for sign-up
@simeng-li simeng-li force-pushed the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch from 89a21e2 to 8a38d05 Compare March 24, 2025 03:49
@github-actions github-actions bot added size/m and removed size/xl labels Mar 24, 2025
@simeng-li simeng-li merged commit 5180368 into master Mar 24, 2025
37 checks passed
@simeng-li simeng-li deleted the simeng-log-10932-experience-update-the-experience-sign-up-form-render-logic branch March 24, 2025 06:01
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.

2 participants