@clerk/ui 1.18.2-snapshot.v20260619001138 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClerkUI.js +2 -2
- package/dist/components/SignIn/SignInStart.js +43 -39
- package/dist/components/SignIn/SignInStart.js.map +1 -1
- package/dist/components/SignUp/SignUpForm.js +3 -4
- package/dist/components/SignUp/SignUpForm.js.map +1 -1
- package/dist/components/SignUp/SignUpStart.js +10 -3
- package/dist/components/SignUp/SignUpStart.js.map +1 -1
- package/dist/elements/CaptchaElement.js +33 -6
- package/dist/elements/CaptchaElement.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/no-rhc/ClerkUI.js +2 -2
- package/dist/no-rhc/components/SignIn/SignInStart.js +43 -39
- package/dist/no-rhc/components/SignIn/SignInStart.js.map +1 -1
- package/dist/no-rhc/components/SignUp/SignUpForm.js +3 -4
- package/dist/no-rhc/components/SignUp/SignUpForm.js.map +1 -1
- package/dist/no-rhc/components/SignUp/SignUpStart.js +10 -3
- package/dist/no-rhc/components/SignUp/SignUpStart.js.map +1 -1
- package/dist/no-rhc/elements/CaptchaElement.js +33 -6
- package/dist/no-rhc/elements/CaptchaElement.js.map +1 -1
- package/dist/no-rhc/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/{signin_ui_223a51_1.18.2-snapshot.v20260619001138.js → signin_ui_06ac63_1.19.0.js} +1 -1
- package/dist/{signin_ui_2d4696_1.18.2-snapshot.v20260619001138.js → signin_ui_57de18_1.19.0.js} +1 -1
- package/dist/{signin_ui_12f27a_1.18.2-snapshot.v20260619001138.js → signin_ui_7c22f7_1.19.0.js} +1 -1
- package/dist/signup_ui_06ac63_1.19.0.js +1 -0
- package/dist/signup_ui_57de18_1.19.0.js +1 -0
- package/dist/signup_ui_7c22f7_1.19.0.js +1 -0
- package/dist/{ui-common_ui_223a51_1.18.2-snapshot.v20260619001138.js → ui-common_ui_06ac63_1.19.0.js} +3 -3
- package/dist/ui-common_ui_57de18_1.19.0.js +1 -0
- package/dist/{ui-common_ui_12f27a_1.18.2-snapshot.v20260619001138.js → ui-common_ui_7c22f7_1.19.0.js} +3 -3
- package/dist/ui.browser.js +2 -2
- package/dist/ui.legacy.browser.js +1 -1
- package/dist/ui.shared.browser.js +3 -3
- package/package.json +4 -4
- package/dist/signup_ui_12f27a_1.18.2-snapshot.v20260619001138.js +0 -1
- package/dist/signup_ui_223a51_1.18.2-snapshot.v20260619001138.js +0 -1
- package/dist/signup_ui_2d4696_1.18.2-snapshot.v20260619001138.js +0 -1
- package/dist/ui-common_ui_2d4696_1.18.2-snapshot.v20260619001138.js +0 -1
- /package/dist/{1390_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 1390_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{1390_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 1390_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{390_ui_223a51_1.18.2-snapshot.v20260619001138.js → 390_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{419_ui_223a51_1.18.2-snapshot.v20260619001138.js → 419_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{424_ui_223a51_1.18.2-snapshot.v20260619001138.js → 424_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{4424_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 4424_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{4424_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 4424_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{4718_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 4718_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{4718_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 4718_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{6678_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 6678_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{6678_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 6678_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{678_ui_223a51_1.18.2-snapshot.v20260619001138.js → 678_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{718_ui_223a51_1.18.2-snapshot.v20260619001138.js → 718_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{746_ui_223a51_1.18.2-snapshot.v20260619001138.js → 746_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{76_ui_223a51_1.18.2-snapshot.v20260619001138.js → 76_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{76_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 76_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{76_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 76_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{8746_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 8746_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{8746_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 8746_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{9419_ui_2d4696_1.18.2-snapshot.v20260619001138.js → 9419_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{9419_ui_12f27a_1.18.2-snapshot.v20260619001138.js → 9419_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{apiKeys_ui_223a51_1.18.2-snapshot.v20260619001138.js → apiKeys_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{apiKeys_ui_2d4696_1.18.2-snapshot.v20260619001138.js → apiKeys_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{apiKeys_ui_12f27a_1.18.2-snapshot.v20260619001138.js → apiKeys_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{blankcaptcha_ui_223a51_1.18.2-snapshot.v20260619001138.js → blankcaptcha_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{blankcaptcha_ui_2d4696_1.18.2-snapshot.v20260619001138.js → blankcaptcha_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{blankcaptcha_ui_12f27a_1.18.2-snapshot.v20260619001138.js → blankcaptcha_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{checkout_ui_223a51_1.18.2-snapshot.v20260619001138.js → checkout_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{checkout_ui_2d4696_1.18.2-snapshot.v20260619001138.js → checkout_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{checkout_ui_12f27a_1.18.2-snapshot.v20260619001138.js → checkout_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{configureSSO_ui_223a51_1.18.2-snapshot.v20260619001138.js → configureSSO_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{configureSSO_ui_2d4696_1.18.2-snapshot.v20260619001138.js → configureSSO_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{configureSSO_ui_12f27a_1.18.2-snapshot.v20260619001138.js → configureSSO_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_223a51_1.18.2-snapshot.v20260619001138.js → copy-api-key-modal_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_2d4696_1.18.2-snapshot.v20260619001138.js → copy-api-key-modal_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_12f27a_1.18.2-snapshot.v20260619001138.js → copy-api-key-modal_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{createorganization_ui_223a51_1.18.2-snapshot.v20260619001138.js → createorganization_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{createorganization_ui_2d4696_1.18.2-snapshot.v20260619001138.js → createorganization_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{createorganization_ui_12f27a_1.18.2-snapshot.v20260619001138.js → createorganization_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_223a51_1.18.2-snapshot.v20260619001138.js → enableOrganizationsPrompt_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_2d4696_1.18.2-snapshot.v20260619001138.js → enableOrganizationsPrompt_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_12f27a_1.18.2-snapshot.v20260619001138.js → enableOrganizationsPrompt_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{framework_ui_2d4696_1.18.2-snapshot.v20260619001138.js → framework_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{framework_ui_12f27a_1.18.2-snapshot.v20260619001138.js → framework_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{impersonationfab_ui_223a51_1.18.2-snapshot.v20260619001138.js → impersonationfab_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{impersonationfab_ui_2d4696_1.18.2-snapshot.v20260619001138.js → impersonationfab_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{impersonationfab_ui_12f27a_1.18.2-snapshot.v20260619001138.js → impersonationfab_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{keylessPrompt_ui_223a51_1.18.2-snapshot.v20260619001138.js → keylessPrompt_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{keylessPrompt_ui_2d4696_1.18.2-snapshot.v20260619001138.js → keylessPrompt_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{keylessPrompt_ui_12f27a_1.18.2-snapshot.v20260619001138.js → keylessPrompt_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{oauthConsent_ui_223a51_1.18.2-snapshot.v20260619001138.js → oauthConsent_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{oauthConsent_ui_2d4696_1.18.2-snapshot.v20260619001138.js → oauthConsent_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{oauthConsent_ui_12f27a_1.18.2-snapshot.v20260619001138.js → oauthConsent_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{onetap_ui_223a51_1.18.2-snapshot.v20260619001138.js → onetap_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{onetap_ui_2d4696_1.18.2-snapshot.v20260619001138.js → onetap_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{onetap_ui_12f27a_1.18.2-snapshot.v20260619001138.js → onetap_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{op-api-keys-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → op-api-keys-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{op-api-keys-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → op-api-keys-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{op-api-keys-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → op-api-keys-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{op-billing-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → op-billing-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{op-billing-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → op-billing-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{op-billing-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → op-billing-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{op-plans-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → op-plans-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{op-plans-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → op-plans-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{op-plans-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → op-plans-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{op-security-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → op-security-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{op-security-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → op-security-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{op-security-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → op-security-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{organizationlist_ui_223a51_1.18.2-snapshot.v20260619001138.js → organizationlist_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{organizationlist_ui_2d4696_1.18.2-snapshot.v20260619001138.js → organizationlist_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{organizationlist_ui_12f27a_1.18.2-snapshot.v20260619001138.js → organizationlist_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{organizationprofile_ui_223a51_1.18.2-snapshot.v20260619001138.js → organizationprofile_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{organizationprofile_ui_2d4696_1.18.2-snapshot.v20260619001138.js → organizationprofile_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{organizationprofile_ui_12f27a_1.18.2-snapshot.v20260619001138.js → organizationprofile_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{organizationswitcher_ui_223a51_1.18.2-snapshot.v20260619001138.js → organizationswitcher_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{organizationswitcher_ui_2d4696_1.18.2-snapshot.v20260619001138.js → organizationswitcher_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{organizationswitcher_ui_12f27a_1.18.2-snapshot.v20260619001138.js → organizationswitcher_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{payment-attempt-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → payment-attempt-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{payment-attempt-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → payment-attempt-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{payment-attempt-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → payment-attempt-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{planDetails_ui_223a51_1.18.2-snapshot.v20260619001138.js → planDetails_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{planDetails_ui_2d4696_1.18.2-snapshot.v20260619001138.js → planDetails_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{planDetails_ui_12f27a_1.18.2-snapshot.v20260619001138.js → planDetails_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_223a51_1.18.2-snapshot.v20260619001138.js → prefetchorganizationlist_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_2d4696_1.18.2-snapshot.v20260619001138.js → prefetchorganizationlist_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_12f27a_1.18.2-snapshot.v20260619001138.js → prefetchorganizationlist_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{pricingTable_ui_223a51_1.18.2-snapshot.v20260619001138.js → pricingTable_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{pricingTable_ui_2d4696_1.18.2-snapshot.v20260619001138.js → pricingTable_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{pricingTable_ui_12f27a_1.18.2-snapshot.v20260619001138.js → pricingTable_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_223a51_1.18.2-snapshot.v20260619001138.js → revoke-api-key-modal_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_2d4696_1.18.2-snapshot.v20260619001138.js → revoke-api-key-modal_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_12f27a_1.18.2-snapshot.v20260619001138.js → revoke-api-key-modal_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{sessionTasks_ui_223a51_1.18.2-snapshot.v20260619001138.js → sessionTasks_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{sessionTasks_ui_2d4696_1.18.2-snapshot.v20260619001138.js → sessionTasks_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{sessionTasks_ui_12f27a_1.18.2-snapshot.v20260619001138.js → sessionTasks_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{statement-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → statement-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{statement-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → statement-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{statement-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → statement-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{subscriptionDetails_ui_223a51_1.18.2-snapshot.v20260619001138.js → subscriptionDetails_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{subscriptionDetails_ui_2d4696_1.18.2-snapshot.v20260619001138.js → subscriptionDetails_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{subscriptionDetails_ui_12f27a_1.18.2-snapshot.v20260619001138.js → subscriptionDetails_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_223a51_1.18.2-snapshot.v20260619001138.js → taskChooseOrganization_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_2d4696_1.18.2-snapshot.v20260619001138.js → taskChooseOrganization_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_12f27a_1.18.2-snapshot.v20260619001138.js → taskChooseOrganization_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{taskResetPassword_ui_223a51_1.18.2-snapshot.v20260619001138.js → taskResetPassword_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{taskResetPassword_ui_2d4696_1.18.2-snapshot.v20260619001138.js → taskResetPassword_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{taskResetPassword_ui_12f27a_1.18.2-snapshot.v20260619001138.js → taskResetPassword_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{taskSetupMFA_ui_223a51_1.18.2-snapshot.v20260619001138.js → taskSetupMFA_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{taskSetupMFA_ui_2d4696_1.18.2-snapshot.v20260619001138.js → taskSetupMFA_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{taskSetupMFA_ui_12f27a_1.18.2-snapshot.v20260619001138.js → taskSetupMFA_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{up-api-keys-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → up-api-keys-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{up-api-keys-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → up-api-keys-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{up-api-keys-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → up-api-keys-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{up-billing-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → up-billing-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{up-billing-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → up-billing-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{up-billing-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → up-billing-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{up-plans-page_ui_223a51_1.18.2-snapshot.v20260619001138.js → up-plans-page_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{up-plans-page_ui_2d4696_1.18.2-snapshot.v20260619001138.js → up-plans-page_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{up-plans-page_ui_12f27a_1.18.2-snapshot.v20260619001138.js → up-plans-page_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{useravatar_ui_223a51_1.18.2-snapshot.v20260619001138.js → useravatar_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{useravatar_ui_2d4696_1.18.2-snapshot.v20260619001138.js → useravatar_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{useravatar_ui_12f27a_1.18.2-snapshot.v20260619001138.js → useravatar_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{userbutton_ui_223a51_1.18.2-snapshot.v20260619001138.js → userbutton_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{userbutton_ui_2d4696_1.18.2-snapshot.v20260619001138.js → userbutton_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{userbutton_ui_12f27a_1.18.2-snapshot.v20260619001138.js → userbutton_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{userprofile_ui_223a51_1.18.2-snapshot.v20260619001138.js → userprofile_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{userprofile_ui_2d4696_1.18.2-snapshot.v20260619001138.js → userprofile_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{userprofile_ui_12f27a_1.18.2-snapshot.v20260619001138.js → userprofile_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{userverification_ui_223a51_1.18.2-snapshot.v20260619001138.js → userverification_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{userverification_ui_2d4696_1.18.2-snapshot.v20260619001138.js → userverification_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{userverification_ui_12f27a_1.18.2-snapshot.v20260619001138.js → userverification_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{vendors_ui_223a51_1.18.2-snapshot.v20260619001138.js → vendors_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{vendors_ui_2d4696_1.18.2-snapshot.v20260619001138.js → vendors_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{vendors_ui_12f27a_1.18.2-snapshot.v20260619001138.js → vendors_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{waitlist_ui_223a51_1.18.2-snapshot.v20260619001138.js → waitlist_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{waitlist_ui_2d4696_1.18.2-snapshot.v20260619001138.js → waitlist_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{waitlist_ui_12f27a_1.18.2-snapshot.v20260619001138.js → waitlist_ui_7c22f7_1.19.0.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_223a51_1.18.2-snapshot.v20260619001138.js → web3-solana-wallet-buttons_ui_06ac63_1.19.0.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_2d4696_1.18.2-snapshot.v20260619001138.js → web3-solana-wallet-buttons_ui_57de18_1.19.0.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_12f27a_1.18.2-snapshot.v20260619001138.js → web3-solana-wallet-buttons_ui_7c22f7_1.19.0.js} +0 -0
package/dist/ClerkUI.js
CHANGED
|
@@ -22,8 +22,8 @@ import { isVersionAtLeast, parseVersion } from "@clerk/shared/versionCheck";
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
var ClerkUI = class ClerkUI {
|
|
25
|
-
static version = "1.
|
|
26
|
-
version = "1.
|
|
25
|
+
static version = "1.19.0";
|
|
26
|
+
version = "1.19.0";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
|
@@ -105,6 +105,7 @@ function SignInStartInternal() {
|
|
|
105
105
|
}), [ctx.initialValues]);
|
|
106
106
|
const hasSocialOrWeb3Buttons = !!authenticatableSocialStrategies.length || !!web3FirstFactors.length || !!alternativePhoneCodeChannels.length;
|
|
107
107
|
const [shouldAutofocus, setShouldAutofocus] = useState(!isMobileDevice() && !hasSocialOrWeb3Buttons);
|
|
108
|
+
const [captchaIsInteractive, setCaptchaIsInteractive] = useState(false);
|
|
108
109
|
const textIdentifierField = useFormControl("identifier", initialValues[identifierAttribute] || "", {
|
|
109
110
|
...currentIdentifier,
|
|
110
111
|
isRequired: true,
|
|
@@ -389,48 +390,51 @@ function SignInStartInternal() {
|
|
|
389
390
|
})]
|
|
390
391
|
}),
|
|
391
392
|
/* @__PURE__ */ jsx(Card.Alert, { children: card.error }),
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsx(Col, {
|
|
393
394
|
elementDescriptor: descriptors.main,
|
|
394
395
|
gap: 6,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
})
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}), /* @__PURE__ */ jsxs(Col, {
|
|
421
|
-
center: true,
|
|
422
|
-
children: [/* @__PURE__ */ jsx(CaptchaElement, {}), /* @__PURE__ */ jsx(Form.SubmitButton, { hasArrow: true })]
|
|
396
|
+
inert: captchaIsInteractive ? "" : void 0,
|
|
397
|
+
sx: captchaIsInteractive ? { display: "none" } : void 0,
|
|
398
|
+
children: /* @__PURE__ */ jsxs(SocialButtonsReversibleContainerWithDivider, { children: [hasSocialOrWeb3Buttons && /* @__PURE__ */ jsx(SignInSocialButtons, {
|
|
399
|
+
enableWeb3Providers: true,
|
|
400
|
+
enableOAuthProviders: true,
|
|
401
|
+
enableAlternativePhoneCodeProviders: showAlternativePhoneCodeProviders,
|
|
402
|
+
onAlternativePhoneCodeProviderClick
|
|
403
|
+
}), standardFormAttributes.length ? /* @__PURE__ */ jsxs(Form.Root, {
|
|
404
|
+
onSubmit: handleFirstPartySubmit,
|
|
405
|
+
gap: 8,
|
|
406
|
+
children: [/* @__PURE__ */ jsxs(Col, {
|
|
407
|
+
gap: 6,
|
|
408
|
+
children: [/* @__PURE__ */ jsx(Form.ControlRow, {
|
|
409
|
+
elementId: identifierField.id,
|
|
410
|
+
children: /* @__PURE__ */ jsx(DynamicField, {
|
|
411
|
+
actionLabel: nextIdentifier?.action,
|
|
412
|
+
onActionClicked: switchToNextIdentifier,
|
|
413
|
+
...identifierFieldProps,
|
|
414
|
+
autoFocus: shouldAutofocus,
|
|
415
|
+
autoComplete: isWebAuthnAutofillSupported ? "webauthn" : void 0,
|
|
416
|
+
isLastAuthenticationStrategy: isIdentifierLastAuthenticationStrategy
|
|
417
|
+
})
|
|
418
|
+
}), /* @__PURE__ */ jsx(InstantPasswordRow, {
|
|
419
|
+
field: passwordBasedInstance ? instantPasswordField : void 0,
|
|
420
|
+
onForgotPasswordClick: handleForgotPasswordClick
|
|
423
421
|
})]
|
|
424
|
-
})
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
422
|
+
}), /* @__PURE__ */ jsx(Col, {
|
|
423
|
+
center: true,
|
|
424
|
+
children: /* @__PURE__ */ jsx(Form.SubmitButton, { hasArrow: true })
|
|
425
|
+
})]
|
|
426
|
+
}) : null] })
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ jsx(CaptchaElement, {
|
|
429
|
+
gapless: true,
|
|
430
|
+
onInteractiveChange: setCaptchaIsInteractive
|
|
431
|
+
}),
|
|
432
|
+
userSettings.attributes.passkey?.enabled && userSettings.passkeySettings.show_sign_in_button && isWebSupported && /* @__PURE__ */ jsx(Card.Action, {
|
|
433
|
+
elementId: "usePasskey",
|
|
434
|
+
children: /* @__PURE__ */ jsx(Card.ActionLink, {
|
|
435
|
+
localizationKey: localizationKeys("signIn.start.actionLink__use_passkey"),
|
|
436
|
+
onClick: () => authenticateWithPasskey({ flow: "discoverable" })
|
|
437
|
+
})
|
|
434
438
|
})
|
|
435
439
|
] }), /* @__PURE__ */ jsxs(Card.Footer, { children: [userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC && !isCombinedFlow && /* @__PURE__ */ jsxs(Card.Action, {
|
|
436
440
|
elementId: "signIn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInStart.js","names":[],"sources":["../../../src/components/SignIn/SignInStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { clerkInvalidFAPIResponse } from '@clerk/shared/internal/clerk-js/errors';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type {\n ClerkAPIError,\n PhoneCodeChannel,\n PhoneCodeChannelData,\n SignInCreateParams,\n SignInResource,\n} from '@clerk/shared/types';\nimport { isWebAuthnAutofillSupported, isWebAuthnSupported } from '@clerk/shared/webauthn';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { isMobileDevice } from '@/ui/utils/isMobileDevice';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\n\nimport type { SignInStartIdentifier } from '../../common';\nimport {\n getIdentifierControlDisplayValues,\n groupIdentifiers,\n withRedirectToAfterSignIn,\n withRedirectToSignInTask,\n} from '../../common';\nimport { useCoreSignIn, useEnvironment, useSignInContext } from '../../contexts';\nimport { Col, descriptors, Flow, localizationKeys } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useLoadingStatus } from '../../hooks';\nimport { useSupportEmail } from '../../hooks/useSupportEmail';\nimport { useTotalEnabledAuthMethods } from '../../hooks/useTotalEnabledAuthMethods';\nimport { useRouter } from '../../router';\nimport { handleCombinedFlowTransfer } from './handleCombinedFlowTransfer';\nimport {\n hasMultipleEnterpriseConnections,\n SIGN_IN_RESET_PASSWORD_INTENT_PARAM,\n useHandleAuthenticateWithPasskey,\n} from './shared';\nimport { SignInAlternativePhoneCodePhoneNumberCard } from './SignInAlternativePhoneCodePhoneNumberCard';\nimport { SignInSocialButtons } from './SignInSocialButtons';\nimport {\n getPreferredAlternativePhoneChannel,\n getPreferredAlternativePhoneChannelForCombinedFlow,\n getSignUpAttributeFromIdentifier,\n} from './utils';\n\nconst useAutoFillPasskey = () => {\n const [isSupported, setIsSupported] = useState(false);\n const { navigate } = useRouter();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor);\n const { userSettings } = useEnvironment();\n const { passkeySettings, attributes } = userSettings;\n\n useEffect(() => {\n async function runAutofillPasskey() {\n const _isSupported = await isWebAuthnAutofillSupported();\n setIsSupported(_isSupported);\n if (!_isSupported) {\n return;\n }\n\n await authenticateWithPasskey({ flow: 'autofill' });\n }\n\n if (passkeySettings.allow_autofill && attributes.passkey?.enabled) {\n runAutofillPasskey();\n }\n }, []);\n\n return {\n isWebAuthnAutofillSupported: isSupported,\n };\n};\n\nfunction SignInStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const { userSettings, authConfig } = useEnvironment();\n const signIn = useCoreSignIn();\n const { navigate } = useRouter();\n const ctx = useSignInContext();\n const { afterSignInUrl, signUpUrl, waitlistUrl, isCombinedFlow, navigateOnSetActive } = ctx;\n const supportEmail = useSupportEmail();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const identifierAttributes = useMemo<SignInStartIdentifier[]>(\n () => groupIdentifiers(userSettings.enabledFirstFactorIdentifiers),\n [userSettings.enabledFirstFactorIdentifiers],\n );\n const alternativePhoneCodeChannels = userSettings.alternativePhoneCodeChannels;\n\n /**\n * Passkeys\n */\n const { isWebAuthnAutofillSupported } = useAutoFillPasskey();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor);\n const isWebSupported = isWebAuthnSupported();\n\n const onlyPhoneNumberInitialValueExists =\n !!ctx.initialValues?.phoneNumber && !(ctx.initialValues.emailAddress || ctx.initialValues.username);\n const shouldStartWithPhoneNumberIdentifier =\n onlyPhoneNumberInitialValueExists && identifierAttributes.includes('phone_number');\n const [identifierAttribute, setIdentifierAttribute] = useState<SignInStartIdentifier>(\n shouldStartWithPhoneNumberIdentifier ? 'phone_number' : identifierAttributes[0] || '',\n );\n const [hasSwitchedByAutofill, setHasSwitchedByAutofill] = useState(false);\n\n const organizationTicket = getClerkQueryParam('__clerk_ticket') || '';\n const clerkStatus = getClerkQueryParam('__clerk_status') || '';\n\n const standardFormAttributes = userSettings.enabledFirstFactorIdentifiers;\n const web3FirstFactors = userSettings.web3FirstFactors;\n const authenticatableSocialStrategies = userSettings.authenticatableSocialStrategies;\n const passwordBasedInstance = userSettings.instanceIsPasswordBased;\n const { currentIdentifier, nextIdentifier } = getIdentifierControlDisplayValues(\n identifierAttributes,\n identifierAttribute,\n );\n const instantPasswordField = useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__password') as any,\n });\n\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = useState<PhoneCodeChannelData | null>(null);\n\n const showAlternativePhoneCodeProviders = userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const provider: PhoneCodeChannelData | null = getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(provider);\n };\n\n const ctxInitialValues = ctx.initialValues || {};\n const initialValues: Record<SignInStartIdentifier, string | undefined> = useMemo(\n () => ({\n email_address: ctxInitialValues.emailAddress,\n email_address_username: ctxInitialValues.emailAddress || ctxInitialValues.username,\n username: ctxInitialValues.username,\n phone_number: ctxInitialValues.phoneNumber,\n }),\n [ctx.initialValues],\n );\n\n const hasSocialOrWeb3Buttons =\n !!authenticatableSocialStrategies.length || !!web3FirstFactors.length || !!alternativePhoneCodeChannels.length;\n const [shouldAutofocus, setShouldAutofocus] = useState(!isMobileDevice() && !hasSocialOrWeb3Buttons);\n const textIdentifierField = useFormControl('identifier', initialValues[identifierAttribute] || '', {\n ...currentIdentifier,\n isRequired: true,\n transformer: value => value.trim(),\n });\n\n const phoneIdentifierField = useFormControl('identifier', initialValues['phone_number'] || '', {\n ...currentIdentifier,\n isRequired: true,\n });\n\n const identifierField = identifierAttribute === 'phone_number' ? phoneIdentifierField : textIdentifierField;\n\n const switchToNextIdentifier = () => {\n setIdentifierAttribute(\n i => identifierAttributes[(identifierAttributes.indexOf(i) + 1) % identifierAttributes.length],\n );\n setShouldAutofocus(true);\n setHasSwitchedByAutofill(false);\n };\n\n const handlePhoneNumberPaste = (value: string) => {\n textIdentifierField.setValue(initialValues[identifierAttribute] || '');\n phoneIdentifierField.setValue(value);\n setIdentifierAttribute('phone_number');\n setShouldAutofocus(true);\n };\n\n // switch to the phone input (if available) if a \"+\" is entered\n // (either by the browser or the user)\n // this does not work in chrome as it does not fire the change event and the value is\n // not available via js\n useLayoutEffect(() => {\n if (\n identifierField.value.startsWith('+') &&\n identifierAttributes.includes('phone_number') &&\n identifierAttribute !== 'phone_number' &&\n !hasSwitchedByAutofill\n ) {\n handlePhoneNumberPaste(identifierField.value);\n // do not switch automatically on subsequent autofills\n // by the browser to avoid a switch loop\n setHasSwitchedByAutofill(true);\n }\n }, [identifierField.value, identifierAttributes]);\n\n useEffect(() => {\n if (!organizationTicket) {\n return;\n }\n\n if (clerkStatus === 'sign_up') {\n const paramsToForward = new URLSearchParams();\n if (organizationTicket) {\n paramsToForward.set('__clerk_ticket', organizationTicket);\n }\n // We explicitly navigate to 'create' in the combined flow to trigger a client-side navigation. Navigating to\n // signUpUrl triggers a full page reload when used with the hash router.\n void navigate(isCombinedFlow ? `create` : signUpUrl, { searchParams: paramsToForward });\n return;\n }\n\n status.setLoading();\n card.setLoading();\n signIn\n .create({\n strategy: 'ticket',\n ticket: organizationTicket,\n })\n .then(res => {\n switch (res.status) {\n case 'needs_first_factor': {\n if (!hasOnlyEnterpriseSSOFirstFactors(res) || hasMultipleEnterpriseConnections(res.supportedFirstFactors)) {\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n removeClerkQueryParam('__clerk_ticket');\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n })\n .catch(err => {\n return attemptToRecoverFromSignInError(err);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = !!hasOnlyEnterpriseSSOFirstFactors(signIn);\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n }, []);\n\n useEffect(() => {\n async function handleOauthError() {\n const defaultErrorHandler = () => {\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n };\n\n const error = signIn?.firstFactorVerification?.error;\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.EXTERNAL_ACCOUNT_NOT_FOUND:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED_WAITLIST:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n defaultErrorHandler();\n }\n\n // TODO: This is a workaround in order to reset the sign in attempt\n // so that the oauth error does not persist on full page reloads.\n void (await signIn.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const buildSignInParams = (fields: Array<FormControlState<string>>): SignInCreateParams => {\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n\n /**\n * FAPI will return an error when password is submitted but the user's email matches requires enterprise sso authentication.\n * We need to strip password from the create request, and reconstruct it later.\n */\n if (!hasPassword || userSettings.enterpriseSSO.enabled) {\n fields = fields.filter(f => f.name !== 'password');\n }\n return {\n ...buildRequest(fields),\n ...(hasPassword && !userSettings.enterpriseSSO.enabled && { strategy: 'password' }),\n } as SignInCreateParams;\n };\n\n const safePasswordSignInForEnterpriseSSOInstance = (\n signInCreatePromise: Promise<SignInResource>,\n fields: Array<FormControlState<string>>,\n ) => {\n return signInCreatePromise.then(signInResource => {\n if (!userSettings.enterpriseSSO.enabled) {\n return signInResource;\n }\n /**\n * For instances with Enterprise SSO enabled, perform sign in with password only when it is allowed for the identified user.\n */\n const passwordField = fields.find(f => f.name === 'password')?.value;\n if (!passwordField || signInResource.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n return signInResource;\n }\n return signInResource.attemptFirstFactor({ strategy: 'password', password: passwordField });\n });\n };\n\n const signInWithFields = async (\n fields: Array<FormControlState<string>>,\n options?: { resetPasswordIntent?: boolean },\n ) => {\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fields, authConfig.preferredChannels, 'identifier');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign in request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fields.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fields.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n try {\n const res = await safePasswordSignInForEnterpriseSSOInstance(signIn.create(buildSignInParams(fields)), fields);\n\n switch (res.status) {\n case 'needs_identifier':\n // Check if we need to initiate an enterprise sso flow\n if (res.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n await authenticateWithEnterpriseSSO();\n }\n break;\n case 'needs_first_factor': {\n if (!hasOnlyEnterpriseSSOFirstFactors(res) || hasMultipleEnterpriseConnections(res.supportedFirstFactors)) {\n if (options?.resetPasswordIntent) {\n return navigate('factor-one', {\n searchParams: new URLSearchParams({ [SIGN_IN_RESET_PASSWORD_INTENT_PARAM]: 'true' }),\n });\n }\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n } catch (e: any) {\n return attemptToRecoverFromSignInError(e);\n }\n };\n\n const authenticateWithEnterpriseSSO = async () => {\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignInUrl || '/';\n\n return signIn.authenticateWithRedirect({\n strategy: 'enterprise_sso',\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n continueSignIn: true,\n });\n };\n\n const attemptToRecoverFromSignInError = async (e: any) => {\n if (!e.errors) {\n return;\n }\n const instantPasswordError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVALID_STRATEGY_FOR_USER ||\n e.code === ERROR_CODES.FORM_PASSWORD_INCORRECT ||\n e.code === ERROR_CODES.FORM_PASSWORD_PWNED,\n );\n\n const sessionAlreadyExistsError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === ERROR_CODES.SESSION_EXISTS,\n );\n const alreadySignedInError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === 'identifier_already_signed_in',\n );\n const accountDoesNotExistError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVITATION_ACCOUNT_NOT_EXISTS || e.code === ERROR_CODES.FORM_IDENTIFIER_NOT_FOUND,\n );\n\n if (instantPasswordError) {\n await signInWithFields([identifierField]);\n } else if (sessionAlreadyExistsError) {\n await clerk.setActive({\n session: clerk.client.lastActiveSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (alreadySignedInError) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sid = alreadySignedInError.meta!.sessionId!;\n await clerk.setActive({\n session: sid,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (isCombinedFlow && accountDoesNotExistError) {\n const attribute = getSignUpAttributeFromIdentifier(identifierField);\n\n if (userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST) {\n const waitlistUrl = clerk.buildWaitlistUrl(\n attribute === 'emailAddress'\n ? {\n initialValues: {\n [attribute]: identifierField.value,\n },\n }\n : {},\n );\n return navigate(waitlistUrl);\n }\n\n clerk.client.signUp[attribute] = identifierField.value;\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return handleCombinedFlowTransfer({\n afterSignUpUrl: ctx.afterSignUpUrl || '/',\n clerk,\n handleError: e => handleError(e, [identifierField, instantPasswordField], card.setError),\n identifierAttribute: attribute,\n identifierValue: identifierField.value,\n navigate,\n organizationTicket,\n signUpMode: userSettings.signUp.mode,\n redirectUrl,\n redirectUrlComplete,\n navigateOnSetActive,\n passwordEnabled: userSettings.attributes.password?.required ?? false,\n alternativePhoneCodeChannel:\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannelForCombinedFlow(\n authConfig.preferredChannels,\n attribute,\n identifierField.value,\n ),\n unsafeMetadata: ctx.unsafeMetadata,\n });\n } else {\n handleError(e, [identifierField, instantPasswordField], card.setError);\n }\n };\n\n const handleFirstPartySubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n return signInWithFields([identifierField, instantPasswordField]);\n };\n\n const handleForgotPasswordClick: React.MouseEventHandler = e => {\n e.preventDefault();\n // Surface the same native required-field validation as the Continue button\n // when the identifier is missing\n const form = e.currentTarget.closest('form');\n if (form && !form.reportValidity()) {\n return;\n }\n void signInWithFields([identifierField], { resetPasswordIntent: true });\n };\n\n const DynamicField = useMemo(() => {\n const components = {\n tel: Form.PhoneInput,\n password: Form.PasswordInput,\n text: Form.PlainInput,\n email: Form.PlainInput,\n };\n\n return components[identifierField.type as keyof typeof components];\n }, [identifierField.type]);\n\n if (status.isLoading || clerkStatus === 'sign_up') {\n // clerkStatus being sign_up will trigger a navigation to the sign up flow, so show a loading card instead of\n // rendering the sign in flow.\n return <LoadingCard />;\n }\n\n // @ts-expect-error `action` is not typed\n const { action, validLastAuthenticationStrategies, ...identifierFieldProps } = identifierField.props;\n\n const lastAuthenticationStrategy = clerk.client?.lastAuthenticationStrategy;\n const isIdentifierLastAuthenticationStrategy =\n lastAuthenticationStrategy && totalEnabledAuthMethods > 1\n ? validLastAuthenticationStrategies?.has(lastAuthenticationStrategy)\n : false;\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.titleCombined')\n : localizationKeys('signIn.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.subtitleCombined')\n : localizationKeys('signIn.start.subtitle')\n }\n sx={{\n '&:empty': {\n display: 'none',\n },\n }}\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n {/*TODO: extract main in its own component */}\n <Col\n elementDescriptor={descriptors.main}\n gap={6}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {hasSocialOrWeb3Buttons && (\n <SignInSocialButtons\n enableWeb3Providers\n enableOAuthProviders\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n />\n )}\n {standardFormAttributes.length ? (\n <Form.Root\n onSubmit={handleFirstPartySubmit}\n gap={8}\n >\n <Col gap={6}>\n <Form.ControlRow elementId={identifierField.id}>\n <DynamicField\n actionLabel={nextIdentifier?.action}\n onActionClicked={switchToNextIdentifier}\n {...identifierFieldProps}\n autoFocus={shouldAutofocus}\n autoComplete={isWebAuthnAutofillSupported ? 'webauthn' : undefined}\n isLastAuthenticationStrategy={isIdentifierLastAuthenticationStrategy}\n />\n </Form.ControlRow>\n <InstantPasswordRow\n field={passwordBasedInstance ? instantPasswordField : undefined}\n onForgotPasswordClick={handleForgotPasswordClick}\n />\n </Col>\n <Col center>\n <CaptchaElement />\n <Form.SubmitButton hasArrow />\n </Col>\n </Form.Root>\n ) : null}\n </SocialButtonsReversibleContainerWithDivider>\n {!standardFormAttributes.length && <CaptchaElement />}\n {userSettings.attributes.passkey?.enabled &&\n userSettings.passkeySettings.show_sign_in_button &&\n isWebSupported && (\n <Card.Action elementId={'usePasskey'}>\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__use_passkey')}\n onClick={() => authenticateWithPasskey({ flow: 'discoverable' })}\n />\n </Card.Action>\n )}\n </Col>\n </Card.Content>\n <Card.Footer>\n {userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC && !isCombinedFlow && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink')}\n to={clerk.buildUrlWithAuth(signUpUrl)}\n />\n </Card.Action>\n )}\n {userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText__join_waitlist')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__join_waitlist')}\n to={clerk.buildUrlWithAuth(waitlistUrl)}\n />\n </Card.Action>\n )}\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignInAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleFirstPartySubmit}\n phoneNumberFormState={phoneIdentifierField}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nconst hasOnlyEnterpriseSSOFirstFactors = (signIn: SignInResource): boolean => {\n if (!signIn.supportedFirstFactors?.length) {\n return false;\n }\n\n return signIn.supportedFirstFactors.every(ff => ff.strategy === 'enterprise_sso');\n};\n\nconst InstantPasswordRow = ({\n field,\n onForgotPasswordClick,\n}: {\n field?: FormControlState<'password'>;\n onForgotPasswordClick?: React.MouseEventHandler;\n}) => {\n const [autofilled, setAutofilled] = useState(false);\n const ref = useRef<HTMLInputElement>(null);\n const show = !!(autofilled || field?.value);\n\n // show password if it's autofilled by the browser\n useLayoutEffect(() => {\n const intervalId = setInterval(() => {\n if (ref?.current) {\n const autofilled =\n window.getComputedStyle(ref.current, ':autofill').animationName === 'onAutoFillStart' ||\n // https://github.com/facebook/react/issues/1159#issuecomment-1025423604\n !!ref.current?.matches('*:-webkit-autofill');\n if (autofilled) {\n setAutofilled(autofilled);\n clearInterval(intervalId);\n }\n }\n }, 500);\n\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n useEffect(() => {\n //if the field receives a value, we default to normal behaviour\n if (field?.value && field.value !== '') {\n setAutofilled(false);\n }\n }, [field?.value]);\n\n if (!field) {\n return null;\n }\n\n return (\n <Form.ControlRow\n elementId={field.id}\n aria-hidden={show ? undefined : true}\n sx={\n show\n ? undefined\n : {\n position: 'absolute',\n opacity: 0,\n height: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n marginTop: '-1rem',\n }\n }\n >\n <Form.PasswordInput\n {...field.props}\n actionLabel={show ? localizationKeys('formFieldAction__forgotPassword') : undefined}\n onActionClicked={show ? onForgotPasswordClick : undefined}\n tabIndex={show ? undefined : -1}\n ref={ref}\n />\n </Form.ControlRow>\n );\n};\n\nexport const SignInStart = withRedirectToSignInTask(\n withRedirectToAfterSignIn(withCardStateProvider(SignInStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,2BAA2B;CAC/B,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,uBAAuB,SAAS,YAAY;CAClD,MAAM,0BAA0B,iCAAiC,cAAc;CAC/E,MAAM,EAAE,iBAAiB,eAAe;CACxC,MAAM,EAAE,iBAAiB,eAAe;CAExC,gBAAgB;EACd,eAAe,qBAAqB;GAClC,MAAM,eAAe,MAAM,4BAA4B;GACvD,eAAe,YAAY;GAC3B,IAAI,CAAC,cACH;GAGF,MAAM,wBAAwB,EAAE,MAAM,WAAW,CAAC;EACpD;EAEA,IAAI,gBAAgB,kBAAkB,WAAW,SAAS,SACxD,mBAAmB;CAEvB,GAAG,CAAC,CAAC;CAEL,OAAO,EACL,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CAEvB,GAAG,CAAC,OAAO,KAAK,CAAC;CAEjB,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,KAAK,YAAN;EACE,WAAW,MAAM;EACjB,eAAa,OAAO,SAAY;EAChC,IACE,OACI,SACA;GACE,UAAU;GACV,SAAS;GACT,QAAQ;GACR,UAAU;GACV,eAAe;GACf,WAAW;EACb;YAGN,oBAAC,KAAK,eAAN;GACE,GAAI,MAAM;GACV,aAAa,OAAO,iBAAiB,iCAAiC,IAAI;GAC1E,iBAAiB,OAAO,wBAAwB;GAChD,UAAU,OAAO,SAAY;GACxB;EACN;CACc;AAErB;AAEA,MAAa,cAAc,yBACzB,0BAA0B,sBAAsB,mBAAmB,CAAC,CACtE"}
|
|
1
|
+
{"version":3,"file":"SignInStart.js","names":[],"sources":["../../../src/components/SignIn/SignInStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { clerkInvalidFAPIResponse } from '@clerk/shared/internal/clerk-js/errors';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type {\n ClerkAPIError,\n PhoneCodeChannel,\n PhoneCodeChannelData,\n SignInCreateParams,\n SignInResource,\n} from '@clerk/shared/types';\nimport { isWebAuthnAutofillSupported, isWebAuthnSupported } from '@clerk/shared/webauthn';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { isMobileDevice } from '@/ui/utils/isMobileDevice';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\n\nimport type { SignInStartIdentifier } from '../../common';\nimport {\n getIdentifierControlDisplayValues,\n groupIdentifiers,\n withRedirectToAfterSignIn,\n withRedirectToSignInTask,\n} from '../../common';\nimport { useCoreSignIn, useEnvironment, useSignInContext } from '../../contexts';\nimport { Col, descriptors, Flow, localizationKeys } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useLoadingStatus } from '../../hooks';\nimport { useSupportEmail } from '../../hooks/useSupportEmail';\nimport { useTotalEnabledAuthMethods } from '../../hooks/useTotalEnabledAuthMethods';\nimport { useRouter } from '../../router';\nimport { handleCombinedFlowTransfer } from './handleCombinedFlowTransfer';\nimport {\n hasMultipleEnterpriseConnections,\n SIGN_IN_RESET_PASSWORD_INTENT_PARAM,\n useHandleAuthenticateWithPasskey,\n} from './shared';\nimport { SignInAlternativePhoneCodePhoneNumberCard } from './SignInAlternativePhoneCodePhoneNumberCard';\nimport { SignInSocialButtons } from './SignInSocialButtons';\nimport {\n getPreferredAlternativePhoneChannel,\n getPreferredAlternativePhoneChannelForCombinedFlow,\n getSignUpAttributeFromIdentifier,\n} from './utils';\n\nconst useAutoFillPasskey = () => {\n const [isSupported, setIsSupported] = useState(false);\n const { navigate } = useRouter();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor);\n const { userSettings } = useEnvironment();\n const { passkeySettings, attributes } = userSettings;\n\n useEffect(() => {\n async function runAutofillPasskey() {\n const _isSupported = await isWebAuthnAutofillSupported();\n setIsSupported(_isSupported);\n if (!_isSupported) {\n return;\n }\n\n await authenticateWithPasskey({ flow: 'autofill' });\n }\n\n if (passkeySettings.allow_autofill && attributes.passkey?.enabled) {\n runAutofillPasskey();\n }\n }, []);\n\n return {\n isWebAuthnAutofillSupported: isSupported,\n };\n};\n\nfunction SignInStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const { userSettings, authConfig } = useEnvironment();\n const signIn = useCoreSignIn();\n const { navigate } = useRouter();\n const ctx = useSignInContext();\n const { afterSignInUrl, signUpUrl, waitlistUrl, isCombinedFlow, navigateOnSetActive } = ctx;\n const supportEmail = useSupportEmail();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const identifierAttributes = useMemo<SignInStartIdentifier[]>(\n () => groupIdentifiers(userSettings.enabledFirstFactorIdentifiers),\n [userSettings.enabledFirstFactorIdentifiers],\n );\n const alternativePhoneCodeChannels = userSettings.alternativePhoneCodeChannels;\n\n /**\n * Passkeys\n */\n const { isWebAuthnAutofillSupported } = useAutoFillPasskey();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor);\n const isWebSupported = isWebAuthnSupported();\n\n const onlyPhoneNumberInitialValueExists =\n !!ctx.initialValues?.phoneNumber && !(ctx.initialValues.emailAddress || ctx.initialValues.username);\n const shouldStartWithPhoneNumberIdentifier =\n onlyPhoneNumberInitialValueExists && identifierAttributes.includes('phone_number');\n const [identifierAttribute, setIdentifierAttribute] = useState<SignInStartIdentifier>(\n shouldStartWithPhoneNumberIdentifier ? 'phone_number' : identifierAttributes[0] || '',\n );\n const [hasSwitchedByAutofill, setHasSwitchedByAutofill] = useState(false);\n\n const organizationTicket = getClerkQueryParam('__clerk_ticket') || '';\n const clerkStatus = getClerkQueryParam('__clerk_status') || '';\n\n const standardFormAttributes = userSettings.enabledFirstFactorIdentifiers;\n const web3FirstFactors = userSettings.web3FirstFactors;\n const authenticatableSocialStrategies = userSettings.authenticatableSocialStrategies;\n const passwordBasedInstance = userSettings.instanceIsPasswordBased;\n const { currentIdentifier, nextIdentifier } = getIdentifierControlDisplayValues(\n identifierAttributes,\n identifierAttribute,\n );\n const instantPasswordField = useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__password') as any,\n });\n\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = useState<PhoneCodeChannelData | null>(null);\n\n const showAlternativePhoneCodeProviders = userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const provider: PhoneCodeChannelData | null = getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(provider);\n };\n\n const ctxInitialValues = ctx.initialValues || {};\n const initialValues: Record<SignInStartIdentifier, string | undefined> = useMemo(\n () => ({\n email_address: ctxInitialValues.emailAddress,\n email_address_username: ctxInitialValues.emailAddress || ctxInitialValues.username,\n username: ctxInitialValues.username,\n phone_number: ctxInitialValues.phoneNumber,\n }),\n [ctx.initialValues],\n );\n\n const hasSocialOrWeb3Buttons =\n !!authenticatableSocialStrategies.length || !!web3FirstFactors.length || !!alternativePhoneCodeChannels.length;\n const [shouldAutofocus, setShouldAutofocus] = useState(!isMobileDevice() && !hasSocialOrWeb3Buttons);\n // When the captcha escalates to an interactive challenge, spotlight it by collapsing/inerting the\n // rest of the card (see the descriptors.main column below).\n const [captchaIsInteractive, setCaptchaIsInteractive] = useState(false);\n const textIdentifierField = useFormControl('identifier', initialValues[identifierAttribute] || '', {\n ...currentIdentifier,\n isRequired: true,\n transformer: value => value.trim(),\n });\n\n const phoneIdentifierField = useFormControl('identifier', initialValues['phone_number'] || '', {\n ...currentIdentifier,\n isRequired: true,\n });\n\n const identifierField = identifierAttribute === 'phone_number' ? phoneIdentifierField : textIdentifierField;\n\n const switchToNextIdentifier = () => {\n setIdentifierAttribute(\n i => identifierAttributes[(identifierAttributes.indexOf(i) + 1) % identifierAttributes.length],\n );\n setShouldAutofocus(true);\n setHasSwitchedByAutofill(false);\n };\n\n const handlePhoneNumberPaste = (value: string) => {\n textIdentifierField.setValue(initialValues[identifierAttribute] || '');\n phoneIdentifierField.setValue(value);\n setIdentifierAttribute('phone_number');\n setShouldAutofocus(true);\n };\n\n // switch to the phone input (if available) if a \"+\" is entered\n // (either by the browser or the user)\n // this does not work in chrome as it does not fire the change event and the value is\n // not available via js\n useLayoutEffect(() => {\n if (\n identifierField.value.startsWith('+') &&\n identifierAttributes.includes('phone_number') &&\n identifierAttribute !== 'phone_number' &&\n !hasSwitchedByAutofill\n ) {\n handlePhoneNumberPaste(identifierField.value);\n // do not switch automatically on subsequent autofills\n // by the browser to avoid a switch loop\n setHasSwitchedByAutofill(true);\n }\n }, [identifierField.value, identifierAttributes]);\n\n useEffect(() => {\n if (!organizationTicket) {\n return;\n }\n\n if (clerkStatus === 'sign_up') {\n const paramsToForward = new URLSearchParams();\n if (organizationTicket) {\n paramsToForward.set('__clerk_ticket', organizationTicket);\n }\n // We explicitly navigate to 'create' in the combined flow to trigger a client-side navigation. Navigating to\n // signUpUrl triggers a full page reload when used with the hash router.\n void navigate(isCombinedFlow ? `create` : signUpUrl, { searchParams: paramsToForward });\n return;\n }\n\n status.setLoading();\n card.setLoading();\n signIn\n .create({\n strategy: 'ticket',\n ticket: organizationTicket,\n })\n .then(res => {\n switch (res.status) {\n case 'needs_first_factor': {\n if (!hasOnlyEnterpriseSSOFirstFactors(res) || hasMultipleEnterpriseConnections(res.supportedFirstFactors)) {\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n removeClerkQueryParam('__clerk_ticket');\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n })\n .catch(err => {\n return attemptToRecoverFromSignInError(err);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = !!hasOnlyEnterpriseSSOFirstFactors(signIn);\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n }, []);\n\n useEffect(() => {\n async function handleOauthError() {\n const defaultErrorHandler = () => {\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n };\n\n const error = signIn?.firstFactorVerification?.error;\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.EXTERNAL_ACCOUNT_NOT_FOUND:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED_WAITLIST:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n defaultErrorHandler();\n }\n\n // TODO: This is a workaround in order to reset the sign in attempt\n // so that the oauth error does not persist on full page reloads.\n void (await signIn.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const buildSignInParams = (fields: Array<FormControlState<string>>): SignInCreateParams => {\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n\n /**\n * FAPI will return an error when password is submitted but the user's email matches requires enterprise sso authentication.\n * We need to strip password from the create request, and reconstruct it later.\n */\n if (!hasPassword || userSettings.enterpriseSSO.enabled) {\n fields = fields.filter(f => f.name !== 'password');\n }\n return {\n ...buildRequest(fields),\n ...(hasPassword && !userSettings.enterpriseSSO.enabled && { strategy: 'password' }),\n } as SignInCreateParams;\n };\n\n const safePasswordSignInForEnterpriseSSOInstance = (\n signInCreatePromise: Promise<SignInResource>,\n fields: Array<FormControlState<string>>,\n ) => {\n return signInCreatePromise.then(signInResource => {\n if (!userSettings.enterpriseSSO.enabled) {\n return signInResource;\n }\n /**\n * For instances with Enterprise SSO enabled, perform sign in with password only when it is allowed for the identified user.\n */\n const passwordField = fields.find(f => f.name === 'password')?.value;\n if (!passwordField || signInResource.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n return signInResource;\n }\n return signInResource.attemptFirstFactor({ strategy: 'password', password: passwordField });\n });\n };\n\n const signInWithFields = async (\n fields: Array<FormControlState<string>>,\n options?: { resetPasswordIntent?: boolean },\n ) => {\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fields, authConfig.preferredChannels, 'identifier');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign in request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fields.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fields.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n try {\n const res = await safePasswordSignInForEnterpriseSSOInstance(signIn.create(buildSignInParams(fields)), fields);\n\n switch (res.status) {\n case 'needs_identifier':\n // Check if we need to initiate an enterprise sso flow\n if (res.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n await authenticateWithEnterpriseSSO();\n }\n break;\n case 'needs_first_factor': {\n if (!hasOnlyEnterpriseSSOFirstFactors(res) || hasMultipleEnterpriseConnections(res.supportedFirstFactors)) {\n if (options?.resetPasswordIntent) {\n return navigate('factor-one', {\n searchParams: new URLSearchParams({ [SIGN_IN_RESET_PASSWORD_INTENT_PARAM]: 'true' }),\n });\n }\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n } catch (e: any) {\n return attemptToRecoverFromSignInError(e);\n }\n };\n\n const authenticateWithEnterpriseSSO = async () => {\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignInUrl || '/';\n\n return signIn.authenticateWithRedirect({\n strategy: 'enterprise_sso',\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n continueSignIn: true,\n });\n };\n\n const attemptToRecoverFromSignInError = async (e: any) => {\n if (!e.errors) {\n return;\n }\n const instantPasswordError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVALID_STRATEGY_FOR_USER ||\n e.code === ERROR_CODES.FORM_PASSWORD_INCORRECT ||\n e.code === ERROR_CODES.FORM_PASSWORD_PWNED,\n );\n\n const sessionAlreadyExistsError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === ERROR_CODES.SESSION_EXISTS,\n );\n const alreadySignedInError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === 'identifier_already_signed_in',\n );\n const accountDoesNotExistError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVITATION_ACCOUNT_NOT_EXISTS || e.code === ERROR_CODES.FORM_IDENTIFIER_NOT_FOUND,\n );\n\n if (instantPasswordError) {\n await signInWithFields([identifierField]);\n } else if (sessionAlreadyExistsError) {\n await clerk.setActive({\n session: clerk.client.lastActiveSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (alreadySignedInError) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sid = alreadySignedInError.meta!.sessionId!;\n await clerk.setActive({\n session: sid,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (isCombinedFlow && accountDoesNotExistError) {\n const attribute = getSignUpAttributeFromIdentifier(identifierField);\n\n if (userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST) {\n const waitlistUrl = clerk.buildWaitlistUrl(\n attribute === 'emailAddress'\n ? {\n initialValues: {\n [attribute]: identifierField.value,\n },\n }\n : {},\n );\n return navigate(waitlistUrl);\n }\n\n clerk.client.signUp[attribute] = identifierField.value;\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return handleCombinedFlowTransfer({\n afterSignUpUrl: ctx.afterSignUpUrl || '/',\n clerk,\n handleError: e => handleError(e, [identifierField, instantPasswordField], card.setError),\n identifierAttribute: attribute,\n identifierValue: identifierField.value,\n navigate,\n organizationTicket,\n signUpMode: userSettings.signUp.mode,\n redirectUrl,\n redirectUrlComplete,\n navigateOnSetActive,\n passwordEnabled: userSettings.attributes.password?.required ?? false,\n alternativePhoneCodeChannel:\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannelForCombinedFlow(\n authConfig.preferredChannels,\n attribute,\n identifierField.value,\n ),\n unsafeMetadata: ctx.unsafeMetadata,\n });\n } else {\n handleError(e, [identifierField, instantPasswordField], card.setError);\n }\n };\n\n const handleFirstPartySubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n return signInWithFields([identifierField, instantPasswordField]);\n };\n\n const handleForgotPasswordClick: React.MouseEventHandler = e => {\n e.preventDefault();\n // Surface the same native required-field validation as the Continue button\n // when the identifier is missing\n const form = e.currentTarget.closest('form');\n if (form && !form.reportValidity()) {\n return;\n }\n void signInWithFields([identifierField], { resetPasswordIntent: true });\n };\n\n const DynamicField = useMemo(() => {\n const components = {\n tel: Form.PhoneInput,\n password: Form.PasswordInput,\n text: Form.PlainInput,\n email: Form.PlainInput,\n };\n\n return components[identifierField.type as keyof typeof components];\n }, [identifierField.type]);\n\n if (status.isLoading || clerkStatus === 'sign_up') {\n // clerkStatus being sign_up will trigger a navigation to the sign up flow, so show a loading card instead of\n // rendering the sign in flow.\n return <LoadingCard />;\n }\n\n // @ts-expect-error `action` is not typed\n const { action, validLastAuthenticationStrategies, ...identifierFieldProps } = identifierField.props;\n\n const lastAuthenticationStrategy = clerk.client?.lastAuthenticationStrategy;\n const isIdentifierLastAuthenticationStrategy =\n lastAuthenticationStrategy && totalEnabledAuthMethods > 1\n ? validLastAuthenticationStrategies?.has(lastAuthenticationStrategy)\n : false;\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.titleCombined')\n : localizationKeys('signIn.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.subtitleCombined')\n : localizationKeys('signIn.start.subtitle')\n }\n sx={{\n '&:empty': {\n display: 'none',\n },\n }}\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n {/*TODO: extract main in its own component */}\n <Col\n elementDescriptor={descriptors.main}\n gap={6}\n // @ts-ignore - `inert` is not yet in the installed React types\n inert={captchaIsInteractive ? '' : undefined}\n // `display:none` (not `visibility:hidden`) so the collapsed column leaves flex flow and\n // contributes no `gap` gutter to `Card.Content` — otherwise it injects empty space above\n // the spotlighted captcha. Subtree stays mounted (form state preserved); `inert` is then\n // redundant-but-harmless.\n sx={captchaIsInteractive ? { display: 'none' } : undefined}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {hasSocialOrWeb3Buttons && (\n <SignInSocialButtons\n enableWeb3Providers\n enableOAuthProviders\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n />\n )}\n {standardFormAttributes.length ? (\n <Form.Root\n onSubmit={handleFirstPartySubmit}\n gap={8}\n >\n <Col gap={6}>\n <Form.ControlRow elementId={identifierField.id}>\n <DynamicField\n actionLabel={nextIdentifier?.action}\n onActionClicked={switchToNextIdentifier}\n {...identifierFieldProps}\n autoFocus={shouldAutofocus}\n autoComplete={isWebAuthnAutofillSupported ? 'webauthn' : undefined}\n isLastAuthenticationStrategy={isIdentifierLastAuthenticationStrategy}\n />\n </Form.ControlRow>\n <InstantPasswordRow\n field={passwordBasedInstance ? instantPasswordField : undefined}\n onForgotPasswordClick={handleForgotPasswordClick}\n />\n </Col>\n <Col center>\n <Form.SubmitButton hasArrow />\n </Col>\n </Form.Root>\n ) : null}\n </SocialButtonsReversibleContainerWithDivider>\n </Col>\n <CaptchaElement\n gapless\n onInteractiveChange={setCaptchaIsInteractive}\n />\n {/* Kept outside descriptors.main so the spotlight's `inert` leaves this alternative action reachable. */}\n {userSettings.attributes.passkey?.enabled &&\n userSettings.passkeySettings.show_sign_in_button &&\n isWebSupported && (\n <Card.Action elementId={'usePasskey'}>\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__use_passkey')}\n onClick={() => authenticateWithPasskey({ flow: 'discoverable' })}\n />\n </Card.Action>\n )}\n </Card.Content>\n <Card.Footer>\n {userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC && !isCombinedFlow && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink')}\n to={clerk.buildUrlWithAuth(signUpUrl)}\n />\n </Card.Action>\n )}\n {userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText__join_waitlist')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__join_waitlist')}\n to={clerk.buildUrlWithAuth(waitlistUrl)}\n />\n </Card.Action>\n )}\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignInAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleFirstPartySubmit}\n phoneNumberFormState={phoneIdentifierField}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nconst hasOnlyEnterpriseSSOFirstFactors = (signIn: SignInResource): boolean => {\n if (!signIn.supportedFirstFactors?.length) {\n return false;\n }\n\n return signIn.supportedFirstFactors.every(ff => ff.strategy === 'enterprise_sso');\n};\n\nconst InstantPasswordRow = ({\n field,\n onForgotPasswordClick,\n}: {\n field?: FormControlState<'password'>;\n onForgotPasswordClick?: React.MouseEventHandler;\n}) => {\n const [autofilled, setAutofilled] = useState(false);\n const ref = useRef<HTMLInputElement>(null);\n const show = !!(autofilled || field?.value);\n\n // show password if it's autofilled by the browser\n useLayoutEffect(() => {\n const intervalId = setInterval(() => {\n if (ref?.current) {\n const autofilled =\n window.getComputedStyle(ref.current, ':autofill').animationName === 'onAutoFillStart' ||\n // https://github.com/facebook/react/issues/1159#issuecomment-1025423604\n !!ref.current?.matches('*:-webkit-autofill');\n if (autofilled) {\n setAutofilled(autofilled);\n clearInterval(intervalId);\n }\n }\n }, 500);\n\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n useEffect(() => {\n //if the field receives a value, we default to normal behaviour\n if (field?.value && field.value !== '') {\n setAutofilled(false);\n }\n }, [field?.value]);\n\n if (!field) {\n return null;\n }\n\n return (\n <Form.ControlRow\n elementId={field.id}\n aria-hidden={show ? undefined : true}\n sx={\n show\n ? undefined\n : {\n position: 'absolute',\n opacity: 0,\n height: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n marginTop: '-1rem',\n }\n }\n >\n <Form.PasswordInput\n {...field.props}\n actionLabel={show ? localizationKeys('formFieldAction__forgotPassword') : undefined}\n onActionClicked={show ? onForgotPasswordClick : undefined}\n tabIndex={show ? undefined : -1}\n ref={ref}\n />\n </Form.ControlRow>\n );\n};\n\nexport const SignInStart = withRedirectToSignInTask(\n withRedirectToAfterSignIn(withCardStateProvider(SignInStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,2BAA2B;CAC/B,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,uBAAuB,SAAS,YAAY;CAClD,MAAM,0BAA0B,iCAAiC,cAAc;CAC/E,MAAM,EAAE,iBAAiB,eAAe;CACxC,MAAM,EAAE,iBAAiB,eAAe;CAExC,gBAAgB;EACd,eAAe,qBAAqB;GAClC,MAAM,eAAe,MAAM,4BAA4B;GACvD,eAAe,YAAY;GAC3B,IAAI,CAAC,cACH;GAGF,MAAM,wBAAwB,EAAE,MAAM,WAAW,CAAC;EACpD;EAEA,IAAI,gBAAgB,kBAAkB,WAAW,SAAS,SACxD,mBAAmB;CAEvB,GAAG,CAAC,CAAC;CAEL,OAAO,EACL,6B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AC;CAEL,gBAAgB;EAEd,IAAI,OAAO,SAAS,MAAM,UAAU,IAClC,cAAc,KAAK;CAEvB,GAAG,CAAC,OAAO,KAAK,CAAC;CAEjB,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,KAAK,YAAN;EACE,WAAW,MAAM;EACjB,eAAa,OAAO,SAAY;EAChC,IACE,OACI,SACA;GACE,UAAU;GACV,SAAS;GACT,QAAQ;GACR,UAAU;GACV,eAAe;GACf,WAAW;EACb;YAGN,oBAAC,KAAK,eAAN;GACE,GAAI,MAAM;GACV,aAAa,OAAO,iBAAiB,iCAAiC,IAAI;GAC1E,iBAAiB,OAAO,wBAAwB;GAChD,UAAU,OAAO,SAAY;GACxB;EACN;CACc;AAErB;AAEA,MAAa,cAAc,yBACzB,0BAA0B,sBAAsB,mBAAmB,CAAC,CACtE"}
|
|
@@ -3,7 +3,6 @@ import { useAppearance } from "../../customizables/AppearanceContext.js";
|
|
|
3
3
|
import { mqu } from "../../styledSystem/breakpoints.js";
|
|
4
4
|
import { Col } from "../../customizables/index.js";
|
|
5
5
|
import { Form } from "../../elements/Form.js";
|
|
6
|
-
import { CaptchaElement } from "../../elements/CaptchaElement.js";
|
|
7
6
|
import { LegalCheckbox } from "../../elements/LegalConsentCheckbox.js";
|
|
8
7
|
import React from "react";
|
|
9
8
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
@@ -74,9 +73,9 @@ const SignUpForm = (props) => {
|
|
|
74
73
|
})
|
|
75
74
|
})
|
|
76
75
|
]
|
|
77
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ jsx(Col, {
|
|
78
77
|
center: true,
|
|
79
|
-
children:
|
|
78
|
+
children: /* @__PURE__ */ jsxs(Col, {
|
|
80
79
|
gap: 6,
|
|
81
80
|
sx: { width: "100%" },
|
|
82
81
|
children: [shouldShow("legalAccepted") && /* @__PURE__ */ jsx(Form.ControlRow, {
|
|
@@ -89,7 +88,7 @@ const SignUpForm = (props) => {
|
|
|
89
88
|
hasArrow: true,
|
|
90
89
|
localizationKey: localizationKeys("formButtonPrimary")
|
|
91
90
|
})]
|
|
92
|
-
})
|
|
91
|
+
})
|
|
93
92
|
})]
|
|
94
93
|
});
|
|
95
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpForm.js","names":[],"sources":["../../../src/components/SignUp/SignUpForm.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Form } from '@/ui/elements/Form';\nimport { LegalCheckbox } from '@/ui/elements/LegalConsentCheckbox';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\n\nimport { Col, localizationKeys, useAppearance } from '../../customizables';\nimport {
|
|
1
|
+
{"version":3,"file":"SignUpForm.js","names":[],"sources":["../../../src/components/SignUp/SignUpForm.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Form } from '@/ui/elements/Form';\nimport { LegalCheckbox } from '@/ui/elements/LegalConsentCheckbox';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\n\nimport { Col, localizationKeys, useAppearance } from '../../customizables';\nimport { mqu } from '../../styledSystem';\nimport type { ActiveIdentifier, Fields } from './signUpFormHelpers';\n\ntype SignUpFormProps = {\n handleSubmit: React.FormEventHandler;\n fields: Fields;\n formState: Record<Exclude<keyof Fields, 'ticket'>, FormControlState<any>>;\n canToggleEmailPhone: boolean;\n handleEmailPhoneToggle: (type: ActiveIdentifier) => void;\n onlyLegalAcceptedMissing?: boolean;\n};\n\nexport const SignUpForm = (props: SignUpFormProps) => {\n const {\n handleSubmit,\n fields,\n formState,\n canToggleEmailPhone,\n onlyLegalAcceptedMissing = false,\n handleEmailPhoneToggle,\n } = props;\n const { showOptionalFields } = useAppearance().parsedOptions;\n\n const shouldShow = (name: keyof typeof fields) => {\n // In case both email & phone are optional, then don't take into account the\n // Options showOptionalFields prop and the required field.\n if ((name === 'emailAddress' || name === 'phoneNumber') && canToggleEmailPhone) {\n return !!fields[name];\n }\n\n return !!fields[name] && (showOptionalFields || fields[name]?.required);\n };\n\n return (\n <Form.Root\n onSubmit={handleSubmit}\n gap={8}\n >\n {!onlyLegalAcceptedMissing && (\n <Col gap={6}>\n {(shouldShow('firstName') || shouldShow('lastName')) && (\n <Form.ControlRow\n elementId='name'\n sx={{\n [mqu.sm]: {\n flexWrap: 'wrap',\n },\n }}\n >\n {shouldShow('firstName') && (\n <Form.PlainInput\n {...formState.firstName.props}\n isRequired={fields.firstName?.required}\n isOptional={!fields.firstName?.required}\n />\n )}\n {shouldShow('lastName') && (\n <Form.PlainInput\n {...formState.lastName.props}\n isRequired={fields.lastName?.required}\n isOptional={!fields.lastName?.required}\n />\n )}\n </Form.ControlRow>\n )}\n {shouldShow('username') && (\n <Form.ControlRow elementId='username'>\n <Form.PlainInput\n {...formState.username.props}\n isRequired={fields.username?.required}\n isOptional={!fields.username?.required}\n />\n </Form.ControlRow>\n )}\n {shouldShow('emailAddress') && (\n <Form.ControlRow elementId='emailAddress'>\n <Form.PlainInput\n {...formState.emailAddress.props}\n isRequired={fields.emailAddress?.required}\n isOptional={!fields.emailAddress?.required}\n isDisabled={fields.emailAddress?.disabled}\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_phone') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('phoneNumber') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('phoneNumber') && (\n <Form.ControlRow elementId='phoneNumber'>\n <Form.PhoneInput\n {...formState.phoneNumber.props}\n isRequired={fields.phoneNumber?.required}\n isOptional={!fields.phoneNumber?.required}\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_email') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('emailAddress') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('password') && (\n <Form.ControlRow elementId='password'>\n <Form.PasswordInput\n {...formState.password.props}\n isRequired={fields.password?.required}\n isOptional={!fields.password?.required}\n autoComplete='new-password'\n />\n </Form.ControlRow>\n )}\n </Col>\n )}\n <Col center>\n <Col\n gap={6}\n sx={{\n width: '100%',\n }}\n >\n {shouldShow('legalAccepted') && (\n <Form.ControlRow elementId='legalAccepted'>\n <LegalCheckbox\n {...formState.legalAccepted.props}\n isRequired={fields.legalAccepted?.required}\n />\n </Form.ControlRow>\n )}\n <Form.SubmitButton\n hasArrow\n localizationKey={localizationKeys('formButtonPrimary')}\n />\n </Col>\n </Col>\n </Form.Root>\n );\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,cAAc,UAA2B;CACpD,MAAM,EACJ,cACA,QACA,WACA,qBACA,2BAA2B,OAC3B,2BACE;CACJ,MAAM,EAAE,uBAAuB,cAAc,CAAC,CAAC;CAE/C,MAAM,cAAc,SAA8B;EAGhD,KAAK,SAAS,kBAAkB,SAAS,kBAAkB,qBACzD,OAAO,CAAC,CAAC,OAAO;EAGlB,OAAO,CAAC,CAAC,OAAO,UAAU,sBAAsB,OAAO,KAAK,EAAE;CAChE;CAEA,OACE,qBAAC,KAAK,MAAN;EACE,UAAU;EACV,KAAK;YAFP,CAIG,CAAC,4BACA,qBAAC,KAAD;GAAK,KAAK;aAAV;KACI,WAAW,WAAW,KAAK,WAAW,UAAU,MAChD,qBAAC,KAAK,YAAN;KACE,WAAU;KACV,IAAI,GACD,IAAI,KAAK,EACR,UAAU,OACZ,EACF;eANF,CAQG,WAAW,WAAW,KACrB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,UAAU;MACxB,YAAY,OAAO,WAAW;MAC9B,YAAY,CAAC,OAAO,WAAW;KAChC,IAEF,WAAW,UAAU,KACpB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,SAAS;MACvB,YAAY,OAAO,UAAU;MAC7B,YAAY,CAAC,OAAO,UAAU;KAC/B,EAEY;;IAElB,WAAW,UAAU,KACpB,oBAAC,KAAK,YAAN;KAAiB,WAAU;eACzB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,SAAS;MACvB,YAAY,OAAO,UAAU;MAC7B,YAAY,CAAC,OAAO,UAAU;KAC/B;IACc;IAElB,WAAW,cAAc,KACxB,oBAAC,KAAK,YAAN;KAAiB,WAAU;eACzB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,aAAa;MAC3B,YAAY,OAAO,cAAc;MACjC,YAAY,CAAC,OAAO,cAAc;MAClC,YAAY,OAAO,cAAc;MACjC,aAAa,sBAAsB,iBAAiB,oCAAoC,IAAI;MAC5F,iBAAiB,4BAA4B,uBAAuB,aAAa,IAAI;KACtF;IACc;IAElB,WAAW,aAAa,KACvB,oBAAC,KAAK,YAAN;KAAiB,WAAU;eACzB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,YAAY;MAC1B,YAAY,OAAO,aAAa;MAChC,YAAY,CAAC,OAAO,aAAa;MACjC,aAAa,sBAAsB,iBAAiB,oCAAoC,IAAI;MAC5F,iBAAiB,4BAA4B,uBAAuB,cAAc,IAAI;KACvF;IACc;IAElB,WAAW,UAAU,KACpB,oBAAC,KAAK,YAAN;KAAiB,WAAU;eACzB,oBAAC,KAAK,eAAN;MACE,GAAI,UAAU,SAAS;MACvB,YAAY,OAAO,UAAU;MAC7B,YAAY,CAAC,OAAO,UAAU;MAC9B,cAAa;KACd;IACc;GAEhB;MAEP,oBAAC,KAAD;GAAK;aACH,qBAAC,KAAD;IACE,KAAK;IACL,IAAI,EACF,OAAO,OACT;cAJF,CAMG,WAAW,eAAe,KACzB,oBAAC,KAAK,YAAN;KAAiB,WAAU;eACzB,oBAAC,eAAD;MACE,GAAI,UAAU,cAAc;MAC5B,YAAY,OAAO,eAAe;KACnC;IACc,IAEnB,oBAAC,KAAK,cAAN;KACE;KACA,iBAAiB,iBAAiB,mBAAmB;IACtD,EACE;;EACF,EACI;;AAEf"}
|
|
@@ -63,6 +63,7 @@ function SignUpStartInternal() {
|
|
|
63
63
|
const initialValues = ctx.initialValues || {};
|
|
64
64
|
const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = React.useState(null);
|
|
65
65
|
const [missingRequirementsWithTicket, setMissingRequirementsWithTicket] = React.useState(false);
|
|
66
|
+
const [captchaIsInteractive, setCaptchaIsInteractive] = React.useState(false);
|
|
66
67
|
const { userSettings: { passwordSettings, usernameSettings } } = useEnvironment();
|
|
67
68
|
const { mode } = userSettings.signUp;
|
|
68
69
|
const formState = {
|
|
@@ -336,11 +337,13 @@ function SignUpStartInternal() {
|
|
|
336
337
|
children: [/* @__PURE__ */ jsx(Header.Title, { localizationKey: isCombinedFlow ? localizationKeys("signUp.start.titleCombined") : localizationKeys("signUp.start.title") }), /* @__PURE__ */ jsx(Header.Subtitle, { localizationKey: isCombinedFlow ? localizationKeys("signUp.start.subtitleCombined") : localizationKeys("signUp.start.subtitle") })]
|
|
337
338
|
}),
|
|
338
339
|
/* @__PURE__ */ jsx(Card.Alert, { children: card.error }),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ jsx(Flex, {
|
|
340
341
|
direction: "col",
|
|
341
342
|
elementDescriptor: descriptors.main,
|
|
342
343
|
gap: 6,
|
|
343
|
-
|
|
344
|
+
inert: captchaIsInteractive ? "" : void 0,
|
|
345
|
+
sx: captchaIsInteractive ? { display: "none" } : void 0,
|
|
346
|
+
children: /* @__PURE__ */ jsxs(SocialButtonsReversibleContainerWithDivider, { children: [(showOauthProviders || showWeb3Providers || showAlternativePhoneCodeProviders) && /* @__PURE__ */ jsx(SignUpSocialButtons, {
|
|
344
347
|
enableOAuthProviders: showOauthProviders,
|
|
345
348
|
enableWeb3Providers: showWeb3Providers,
|
|
346
349
|
enableAlternativePhoneCodeProviders: showAlternativePhoneCodeProviders,
|
|
@@ -353,7 +356,11 @@ function SignUpStartInternal() {
|
|
|
353
356
|
formState,
|
|
354
357
|
canToggleEmailPhone,
|
|
355
358
|
handleEmailPhoneToggle: handleChangeActive
|
|
356
|
-
})] })
|
|
359
|
+
})] })
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ jsx(CaptchaElement, {
|
|
362
|
+
gapless: true,
|
|
363
|
+
onInteractiveChange: setCaptchaIsInteractive
|
|
357
364
|
})
|
|
358
365
|
] }), /* @__PURE__ */ jsx(Card.Footer, { children: /* @__PURE__ */ jsxs(Card.Action, {
|
|
359
366
|
elementId: "signUp",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpStart.js","names":[],"sources":["../../../src/components/SignUp/SignUpStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { isClerkAPIResponseError } from '@clerk/shared/error';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type { PhoneCodeChannel, PhoneCodeChannelData, SignUpResource } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { createPasswordError } from '@/ui/utils/passwordUtils';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\nimport { createUsernameError } from '@/ui/utils/usernameUtils';\n\nimport { withRedirectToAfterSignUp, withRedirectToSignUpTask } from '../../common';\nimport { SignInContext, useCoreSignUp, useEnvironment, useSignUpContext } from '../../contexts';\nimport { descriptors, Flex, Flow, localizationKeys, useAppearance, useLocalizations } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useLoadingStatus } from '../../hooks';\nimport { useRouter } from '../../router';\nimport { getPreferredAlternativePhoneChannel } from '../SignIn/utils';\nimport { SignUpForm } from './SignUpForm';\nimport type { ActiveIdentifier } from './signUpFormHelpers';\nimport { determineActiveFields, emailOrPhone, getInitialActiveIdentifier, showFormFields } from './signUpFormHelpers';\nimport { SignUpRestrictedAccess } from './SignUpRestrictedAccess';\nimport { SignUpSocialButtons } from './SignUpSocialButtons';\nimport { SignUpStartAlternativePhoneCodePhoneNumberCard } from './SignUpStartAlternativePhoneCodePhoneNumberCard';\nimport { completeSignUpFlow } from './util';\n\nfunction SignUpStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const signUp = useCoreSignUp();\n const { showOptionalFields } = useAppearance().parsedOptions;\n const { userSettings, authConfig } = useEnvironment();\n const { navigate } = useRouter();\n const { attributes } = userSettings;\n const { setActive } = useClerk();\n const ctx = useSignUpContext();\n const isWithinSignInContext = !!React.useContext(SignInContext);\n const { afterSignUpUrl, signInUrl, unsafeMetadata, navigateOnSetActive } = ctx;\n const isCombinedFlow = !!(ctx.isCombinedFlow && !!isWithinSignInContext);\n const [activeCommIdentifierType, setActiveCommIdentifierType] = React.useState<ActiveIdentifier>(() =>\n getInitialActiveIdentifier(attributes, userSettings.signUp.progressive, {\n phoneNumber: ctx.initialValues?.phoneNumber === null ? undefined : ctx.initialValues?.phoneNumber,\n emailAddress: ctx.initialValues?.emailAddress === null ? undefined : ctx.initialValues?.emailAddress,\n ...(isCombinedFlow\n ? {\n emailAddress: signUp.emailAddress,\n phoneNumber: signUp.phoneNumber,\n }\n : {}),\n }),\n );\n const { t, locale } = useLocalizations();\n const initialValues = ctx.initialValues || {};\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = React.useState<PhoneCodeChannelData | null>(\n null,\n );\n\n const [missingRequirementsWithTicket, setMissingRequirementsWithTicket] = React.useState(false);\n\n const {\n userSettings: { passwordSettings, usernameSettings },\n } = useEnvironment();\n\n const { mode } = userSettings.signUp;\n\n const formState = {\n firstName: useFormControl('firstName', signUp.firstName || initialValues.firstName || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__firstName'),\n placeholder: localizationKeys('formFieldInputPlaceholder__firstName'),\n }),\n lastName: useFormControl('lastName', signUp.lastName || initialValues.lastName || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__lastName'),\n placeholder: localizationKeys('formFieldInputPlaceholder__lastName'),\n }),\n emailAddress: useFormControl('emailAddress', signUp.emailAddress || initialValues.emailAddress || '', {\n type: 'email',\n label: localizationKeys('formFieldLabel__emailAddress'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress'),\n }),\n username: useFormControl('username', signUp.username || initialValues.username || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__username'),\n transformer: value => value.trim(),\n buildErrorMessage: errors => createUsernameError(errors, { t, locale, usernameSettings }),\n }),\n phoneNumber: useFormControl('phoneNumber', signUp.phoneNumber || initialValues.phoneNumber || '', {\n type: 'tel',\n label: localizationKeys('formFieldLabel__phoneNumber'),\n placeholder: localizationKeys('formFieldInputPlaceholder__phoneNumber'),\n }),\n legalAccepted: useFormControl('legalAccepted', '', {\n type: 'checkbox',\n label: '',\n defaultChecked: false,\n isRequired: userSettings.signUp.legal_consent_enabled || false,\n }),\n password: useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__signUpPassword'),\n validatePassword: true,\n buildErrorMessage: errors => createPasswordError(errors, { t, locale, passwordSettings }),\n }),\n ticket: useFormControl(\n 'ticket',\n getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token') || '',\n ),\n } as const;\n\n const hasTicket = !!formState.ticket.value;\n const hasExistingSignUpWithTicket = !!(\n signUp.id &&\n signUp.status !== null &&\n (getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token'))\n );\n const hasEmail = !!formState.emailAddress.value;\n const isProgressiveSignUp = userSettings.signUp.progressive;\n const isLegalConsentEnabled = userSettings.signUp.legal_consent_enabled;\n const oidcPrompt = ctx.oidcPrompt;\n\n const fields = determineActiveFields({\n attributes,\n hasTicket: hasTicket || hasExistingSignUpWithTicket,\n hasEmail,\n activeCommIdentifierType,\n isProgressiveSignUp,\n legalConsentRequired: isLegalConsentEnabled,\n });\n\n const handleTokenFlow = () => {\n if (!formState.ticket.value) {\n return;\n }\n status.setLoading();\n card.setLoading();\n signUp\n .create({ strategy: 'ticket', ticket: formState.ticket.value, unsafeMetadata })\n .then(signUp => {\n formState.emailAddress.setValue(signUp.emailAddress || '');\n // In case we are in a Ticket flow and the sign up is not complete yet, update the state\n // to render properly the SignUp form with other available options to complete it (e.g. OAuth)\n if (signUp.status === 'missing_requirements') {\n setMissingRequirementsWithTicket(true);\n }\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return completeSignUpFlow({\n signUp,\n redirectUrl,\n redirectUrlComplete,\n verifyEmailPath: 'verify-email-address',\n verifyPhonePath: 'verify-phone-number',\n continuePath: 'continue',\n handleComplete: () => {\n removeClerkQueryParam('__clerk_ticket');\n removeClerkQueryParam('__clerk_invitation_token');\n return setActive({\n session: signUp.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignUpUrl, decorateUrl });\n },\n });\n },\n navigate,\n oidcPrompt,\n });\n })\n .catch(err => {\n /* Clear ticket values when an error occurs in the initial sign up attempt */\n formState.ticket.setValue('');\n handleError(err, [], card.setError);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = signUp.missingFields.some(mf => mf === 'enterprise_sso');\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n };\n\n React.useLayoutEffect(() => {\n void handleTokenFlow();\n }, []);\n\n React.useEffect(() => {\n async function handleOauthError() {\n const error = signUp.verifications.externalAccount.error;\n\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n }\n\n // TODO: This is a hack to reset the sign in attempt so that the oauth error\n // does not persist on full page reloads.\n // We will revise this strategy as part of the Clerk DX epic.\n void (await signUp.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const handleChangeActive = (type: ActiveIdentifier) => {\n if (!emailOrPhone(attributes, isProgressiveSignUp)) {\n return;\n }\n setActiveCommIdentifierType(type);\n };\n\n const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n type FormStateKey = keyof typeof formState;\n const fieldsToSubmit = Object.entries(fields).reduce((acc, [k, v]) => {\n acc.push(...(v && formState[k as FormStateKey] ? [formState[k as FormStateKey]] : []));\n return acc;\n }, [] as Array<FormControlState>);\n\n if (unsafeMetadata) {\n const noop = () => {};\n fieldsToSubmit.push({\n id: 'unsafeMetadata',\n value: unsafeMetadata,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n\n if (fields.ticket || hasExistingSignUpWithTicket) {\n const noop = () => {};\n // fieldsToSubmit: Constructing a fake fields object for strategy.\n fieldsToSubmit.push({\n id: 'strategy',\n value: 'ticket',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n\n // Get ticket value from query params if it exists\n if (!formState.ticket.value && hasExistingSignUpWithTicket) {\n const ticketValue = getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token');\n if (ticketValue) {\n fieldsToSubmit.push({\n id: 'ticket',\n value: ticketValue,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n }\n }\n\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fieldsToSubmit, authConfig.preferredChannels, 'phoneNumber');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign up request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fieldsToSubmit.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fieldsToSubmit.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n\n // In case of emailOrPhone (both email & phone are optional) and neither of them is provided,\n // add both to the submitted fields to trigger and render an error for both respective inputs\n const emailAddressProvided = !!(fieldsToSubmit.find(f => f.id === 'emailAddress')?.value || '');\n const phoneNumberProvided = !!(fieldsToSubmit.find(f => f.id === 'phoneNumber')?.value || '');\n\n if (!emailAddressProvided && !phoneNumberProvided && emailOrPhone(attributes, isProgressiveSignUp)) {\n fieldsToSubmit.push(formState.emailAddress);\n fieldsToSubmit.push(formState.phoneNumber);\n }\n\n card.setLoading();\n card.setError(undefined);\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n let signUpAttempt: Promise<SignUpResource>;\n if (!fields.ticket && !hasExistingSignUpWithTicket) {\n signUpAttempt = signUp.create(buildRequest(fieldsToSubmit));\n } else {\n signUpAttempt = signUp.upsert(buildRequest(fieldsToSubmit));\n }\n\n return signUpAttempt\n .then(res =>\n completeSignUpFlow({\n signUp: res,\n verifyEmailPath: 'verify-email-address',\n verifyPhonePath: 'verify-phone-number',\n handleComplete: () =>\n setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignUpUrl, decorateUrl });\n },\n }),\n navigate,\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt,\n }),\n )\n .catch(err => {\n /**\n * @experimental\n */\n if (\n isClerkAPIResponseError(err) &&\n err.errors?.[0]?.code === 'enterprise_connection_id_is_required_with_multiple_connections'\n ) {\n return navigate('./enterprise-connections');\n }\n\n return handleError(err, fieldsToSubmit, card.setError);\n })\n .finally(() => card.setIdle());\n };\n\n if (status.isLoading) {\n return <LoadingCard />;\n }\n\n const canToggleEmailPhone = emailOrPhone(attributes, isProgressiveSignUp);\n const visibleFields = Object.entries(fields).filter(([key, opts]) => {\n // In case both email & phone are optional (emailOrPhone case), always show the active identifier\n if ((key === 'emailAddress' || key === 'phoneNumber') && canToggleEmailPhone) {\n return !!opts;\n }\n return showOptionalFields || opts?.required;\n });\n const shouldShowForm = showFormFields(userSettings) && visibleFields.length > 0;\n\n const showOauthProviders =\n (!(hasTicket || hasExistingSignUpWithTicket) || missingRequirementsWithTicket) &&\n userSettings.authenticatableSocialStrategies.length > 0;\n const showWeb3Providers = !(hasTicket || hasExistingSignUpWithTicket) && userSettings.web3FirstFactors.length > 0;\n const showAlternativePhoneCodeProviders =\n !(hasTicket || hasExistingSignUpWithTicket) && userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const phoneCodeProvider: PhoneCodeChannelData | null =\n getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(phoneCodeProvider);\n };\n\n if (mode !== SIGN_UP_MODES.PUBLIC && !(hasTicket || hasExistingSignUpWithTicket)) {\n return <SignUpRestrictedAccess />;\n }\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signUp.start.titleCombined')\n : localizationKeys('signUp.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signUp.start.subtitleCombined')\n : localizationKeys('signUp.start.subtitle')\n }\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n <Flex\n direction='col'\n elementDescriptor={descriptors.main}\n gap={6}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {(showOauthProviders || showWeb3Providers || showAlternativePhoneCodeProviders) && (\n <SignUpSocialButtons\n enableOAuthProviders={showOauthProviders}\n enableWeb3Providers={showWeb3Providers}\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n continueSignUp={missingRequirementsWithTicket}\n legalAccepted={Boolean(formState.legalAccepted.checked) || undefined}\n />\n )}\n {shouldShowForm && (\n <SignUpForm\n handleSubmit={handleSubmit}\n fields={fields}\n formState={formState}\n canToggleEmailPhone={canToggleEmailPhone}\n handleEmailPhoneToggle={handleChangeActive}\n />\n )}\n </SocialButtonsReversibleContainerWithDivider>\n {!shouldShowForm && <CaptchaElement />}\n </Flex>\n </Card.Content>\n\n <Card.Footer>\n <Card.Action elementId='signUp'>\n <Card.ActionText localizationKey={localizationKeys('signUp.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signUp.start.actionLink')}\n to={isCombinedFlow ? '../' : clerk.buildUrlWithAuth(signInUrl)}\n />\n </Card.Action>\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignUpStartAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleSubmit}\n fields={fields}\n formState={formState}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nexport const SignUpStart = withRedirectToSignUpTask(\n withRedirectToAfterSignUp(withCardStateProvider(SignUpStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,sBAAmC;CAC1C,MAAM,OAAO,aAAa;CAC1B,MAAM,QAAQ,SAAS;CACvB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,cAAc;CAC7B,MAAM,EAAE,uBAAuB,cAAc,CAAC,CAAC;CAC/C,MAAM,EAAE,cAAc,eAAe,eAAe;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,EAAE,eAAe;CACvB,MAAM,EAAE,cAAc,SAAS;CAC/B,MAAM,MAAM,iBAAiB;CAC7B,MAAM,wBAAwB,CAAC,CAAC,MAAM,WAAW,aAAa;CAC9D,MAAM,EAAE,gBAAgB,WAAW,gBAAgB,wBAAwB;CAC3E,MAAM,iBAAiB,CAAC,EAAE,IAAI,kBAAkB,CAAC,CAAC;CAClD,MAAM,CAAC,0BAA0B,+BAA+B,MAAM,eACpE,2BAA2B,YAAY,aAAa,OAAO,aAAa;EACtE,aAAa,IAAI,eAAe,gBAAgB,OAAO,SAAY,IAAI,eAAe;EACtF,cAAc,IAAI,eAAe,iBAAiB,OAAO,SAAY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S;GAC9D,EACU;KACF,EACJ,OAEX,oBAAC,gDAAD;GACgB;GACN;GACG;GACX,oBAAoB;GACpB,mBAAmB;EACpB;CAEM;AAEf;AAEA,MAAa,cAAc,yBACzB,0BAA0B,sBAAsB,mBAAmB,CAAC,CACtE"}
|
|
1
|
+
{"version":3,"file":"SignUpStart.js","names":[],"sources":["../../../src/components/SignUp/SignUpStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { isClerkAPIResponseError } from '@clerk/shared/error';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type { PhoneCodeChannel, PhoneCodeChannelData, SignUpResource } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { createPasswordError } from '@/ui/utils/passwordUtils';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\nimport { createUsernameError } from '@/ui/utils/usernameUtils';\n\nimport { withRedirectToAfterSignUp, withRedirectToSignUpTask } from '../../common';\nimport { SignInContext, useCoreSignUp, useEnvironment, useSignUpContext } from '../../contexts';\nimport { descriptors, Flex, Flow, localizationKeys, useAppearance, useLocalizations } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useLoadingStatus } from '../../hooks';\nimport { useRouter } from '../../router';\nimport { getPreferredAlternativePhoneChannel } from '../SignIn/utils';\nimport { SignUpForm } from './SignUpForm';\nimport type { ActiveIdentifier } from './signUpFormHelpers';\nimport { determineActiveFields, emailOrPhone, getInitialActiveIdentifier, showFormFields } from './signUpFormHelpers';\nimport { SignUpRestrictedAccess } from './SignUpRestrictedAccess';\nimport { SignUpSocialButtons } from './SignUpSocialButtons';\nimport { SignUpStartAlternativePhoneCodePhoneNumberCard } from './SignUpStartAlternativePhoneCodePhoneNumberCard';\nimport { completeSignUpFlow } from './util';\n\nfunction SignUpStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const signUp = useCoreSignUp();\n const { showOptionalFields } = useAppearance().parsedOptions;\n const { userSettings, authConfig } = useEnvironment();\n const { navigate } = useRouter();\n const { attributes } = userSettings;\n const { setActive } = useClerk();\n const ctx = useSignUpContext();\n const isWithinSignInContext = !!React.useContext(SignInContext);\n const { afterSignUpUrl, signInUrl, unsafeMetadata, navigateOnSetActive } = ctx;\n const isCombinedFlow = !!(ctx.isCombinedFlow && !!isWithinSignInContext);\n const [activeCommIdentifierType, setActiveCommIdentifierType] = React.useState<ActiveIdentifier>(() =>\n getInitialActiveIdentifier(attributes, userSettings.signUp.progressive, {\n phoneNumber: ctx.initialValues?.phoneNumber === null ? undefined : ctx.initialValues?.phoneNumber,\n emailAddress: ctx.initialValues?.emailAddress === null ? undefined : ctx.initialValues?.emailAddress,\n ...(isCombinedFlow\n ? {\n emailAddress: signUp.emailAddress,\n phoneNumber: signUp.phoneNumber,\n }\n : {}),\n }),\n );\n const { t, locale } = useLocalizations();\n const initialValues = ctx.initialValues || {};\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = React.useState<PhoneCodeChannelData | null>(\n null,\n );\n\n const [missingRequirementsWithTicket, setMissingRequirementsWithTicket] = React.useState(false);\n // When the captcha escalates to an interactive challenge, spotlight it by collapsing/inerting the\n // rest of the card (see the descriptors.main column below).\n const [captchaIsInteractive, setCaptchaIsInteractive] = React.useState(false);\n\n const {\n userSettings: { passwordSettings, usernameSettings },\n } = useEnvironment();\n\n const { mode } = userSettings.signUp;\n\n const formState = {\n firstName: useFormControl('firstName', signUp.firstName || initialValues.firstName || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__firstName'),\n placeholder: localizationKeys('formFieldInputPlaceholder__firstName'),\n }),\n lastName: useFormControl('lastName', signUp.lastName || initialValues.lastName || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__lastName'),\n placeholder: localizationKeys('formFieldInputPlaceholder__lastName'),\n }),\n emailAddress: useFormControl('emailAddress', signUp.emailAddress || initialValues.emailAddress || '', {\n type: 'email',\n label: localizationKeys('formFieldLabel__emailAddress'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress'),\n }),\n username: useFormControl('username', signUp.username || initialValues.username || '', {\n type: 'text',\n label: localizationKeys('formFieldLabel__username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__username'),\n transformer: value => value.trim(),\n buildErrorMessage: errors => createUsernameError(errors, { t, locale, usernameSettings }),\n }),\n phoneNumber: useFormControl('phoneNumber', signUp.phoneNumber || initialValues.phoneNumber || '', {\n type: 'tel',\n label: localizationKeys('formFieldLabel__phoneNumber'),\n placeholder: localizationKeys('formFieldInputPlaceholder__phoneNumber'),\n }),\n legalAccepted: useFormControl('legalAccepted', '', {\n type: 'checkbox',\n label: '',\n defaultChecked: false,\n isRequired: userSettings.signUp.legal_consent_enabled || false,\n }),\n password: useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__signUpPassword'),\n validatePassword: true,\n buildErrorMessage: errors => createPasswordError(errors, { t, locale, passwordSettings }),\n }),\n ticket: useFormControl(\n 'ticket',\n getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token') || '',\n ),\n } as const;\n\n const hasTicket = !!formState.ticket.value;\n const hasExistingSignUpWithTicket = !!(\n signUp.id &&\n signUp.status !== null &&\n (getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token'))\n );\n const hasEmail = !!formState.emailAddress.value;\n const isProgressiveSignUp = userSettings.signUp.progressive;\n const isLegalConsentEnabled = userSettings.signUp.legal_consent_enabled;\n const oidcPrompt = ctx.oidcPrompt;\n\n const fields = determineActiveFields({\n attributes,\n hasTicket: hasTicket || hasExistingSignUpWithTicket,\n hasEmail,\n activeCommIdentifierType,\n isProgressiveSignUp,\n legalConsentRequired: isLegalConsentEnabled,\n });\n\n const handleTokenFlow = () => {\n if (!formState.ticket.value) {\n return;\n }\n status.setLoading();\n card.setLoading();\n signUp\n .create({ strategy: 'ticket', ticket: formState.ticket.value, unsafeMetadata })\n .then(signUp => {\n formState.emailAddress.setValue(signUp.emailAddress || '');\n // In case we are in a Ticket flow and the sign up is not complete yet, update the state\n // to render properly the SignUp form with other available options to complete it (e.g. OAuth)\n if (signUp.status === 'missing_requirements') {\n setMissingRequirementsWithTicket(true);\n }\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return completeSignUpFlow({\n signUp,\n redirectUrl,\n redirectUrlComplete,\n verifyEmailPath: 'verify-email-address',\n verifyPhonePath: 'verify-phone-number',\n continuePath: 'continue',\n handleComplete: () => {\n removeClerkQueryParam('__clerk_ticket');\n removeClerkQueryParam('__clerk_invitation_token');\n return setActive({\n session: signUp.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignUpUrl, decorateUrl });\n },\n });\n },\n navigate,\n oidcPrompt,\n });\n })\n .catch(err => {\n /* Clear ticket values when an error occurs in the initial sign up attempt */\n formState.ticket.setValue('');\n handleError(err, [], card.setError);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = signUp.missingFields.some(mf => mf === 'enterprise_sso');\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n };\n\n React.useLayoutEffect(() => {\n void handleTokenFlow();\n }, []);\n\n React.useEffect(() => {\n async function handleOauthError() {\n const error = signUp.verifications.externalAccount.error;\n\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n }\n\n // TODO: This is a hack to reset the sign in attempt so that the oauth error\n // does not persist on full page reloads.\n // We will revise this strategy as part of the Clerk DX epic.\n void (await signUp.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const handleChangeActive = (type: ActiveIdentifier) => {\n if (!emailOrPhone(attributes, isProgressiveSignUp)) {\n return;\n }\n setActiveCommIdentifierType(type);\n };\n\n const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n type FormStateKey = keyof typeof formState;\n const fieldsToSubmit = Object.entries(fields).reduce((acc, [k, v]) => {\n acc.push(...(v && formState[k as FormStateKey] ? [formState[k as FormStateKey]] : []));\n return acc;\n }, [] as Array<FormControlState>);\n\n if (unsafeMetadata) {\n const noop = () => {};\n fieldsToSubmit.push({\n id: 'unsafeMetadata',\n value: unsafeMetadata,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n\n if (fields.ticket || hasExistingSignUpWithTicket) {\n const noop = () => {};\n // fieldsToSubmit: Constructing a fake fields object for strategy.\n fieldsToSubmit.push({\n id: 'strategy',\n value: 'ticket',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n\n // Get ticket value from query params if it exists\n if (!formState.ticket.value && hasExistingSignUpWithTicket) {\n const ticketValue = getClerkQueryParam('__clerk_ticket') || getClerkQueryParam('__clerk_invitation_token');\n if (ticketValue) {\n fieldsToSubmit.push({\n id: 'ticket',\n value: ticketValue,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n }\n }\n\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fieldsToSubmit, authConfig.preferredChannels, 'phoneNumber');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign up request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fieldsToSubmit.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fieldsToSubmit.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n\n // In case of emailOrPhone (both email & phone are optional) and neither of them is provided,\n // add both to the submitted fields to trigger and render an error for both respective inputs\n const emailAddressProvided = !!(fieldsToSubmit.find(f => f.id === 'emailAddress')?.value || '');\n const phoneNumberProvided = !!(fieldsToSubmit.find(f => f.id === 'phoneNumber')?.value || '');\n\n if (!emailAddressProvided && !phoneNumberProvided && emailOrPhone(attributes, isProgressiveSignUp)) {\n fieldsToSubmit.push(formState.emailAddress);\n fieldsToSubmit.push(formState.phoneNumber);\n }\n\n card.setLoading();\n card.setError(undefined);\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n let signUpAttempt: Promise<SignUpResource>;\n if (!fields.ticket && !hasExistingSignUpWithTicket) {\n signUpAttempt = signUp.create(buildRequest(fieldsToSubmit));\n } else {\n signUpAttempt = signUp.upsert(buildRequest(fieldsToSubmit));\n }\n\n return signUpAttempt\n .then(res =>\n completeSignUpFlow({\n signUp: res,\n verifyEmailPath: 'verify-email-address',\n verifyPhonePath: 'verify-phone-number',\n handleComplete: () =>\n setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignUpUrl, decorateUrl });\n },\n }),\n navigate,\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt,\n }),\n )\n .catch(err => {\n /**\n * @experimental\n */\n if (\n isClerkAPIResponseError(err) &&\n err.errors?.[0]?.code === 'enterprise_connection_id_is_required_with_multiple_connections'\n ) {\n return navigate('./enterprise-connections');\n }\n\n return handleError(err, fieldsToSubmit, card.setError);\n })\n .finally(() => card.setIdle());\n };\n\n if (status.isLoading) {\n return <LoadingCard />;\n }\n\n const canToggleEmailPhone = emailOrPhone(attributes, isProgressiveSignUp);\n const visibleFields = Object.entries(fields).filter(([key, opts]) => {\n // In case both email & phone are optional (emailOrPhone case), always show the active identifier\n if ((key === 'emailAddress' || key === 'phoneNumber') && canToggleEmailPhone) {\n return !!opts;\n }\n return showOptionalFields || opts?.required;\n });\n const shouldShowForm = showFormFields(userSettings) && visibleFields.length > 0;\n\n const showOauthProviders =\n (!(hasTicket || hasExistingSignUpWithTicket) || missingRequirementsWithTicket) &&\n userSettings.authenticatableSocialStrategies.length > 0;\n const showWeb3Providers = !(hasTicket || hasExistingSignUpWithTicket) && userSettings.web3FirstFactors.length > 0;\n const showAlternativePhoneCodeProviders =\n !(hasTicket || hasExistingSignUpWithTicket) && userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const phoneCodeProvider: PhoneCodeChannelData | null =\n getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(phoneCodeProvider);\n };\n\n if (mode !== SIGN_UP_MODES.PUBLIC && !(hasTicket || hasExistingSignUpWithTicket)) {\n return <SignUpRestrictedAccess />;\n }\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signUp.start.titleCombined')\n : localizationKeys('signUp.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signUp.start.subtitleCombined')\n : localizationKeys('signUp.start.subtitle')\n }\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n <Flex\n direction='col'\n elementDescriptor={descriptors.main}\n gap={6}\n // @ts-ignore - `inert` is not yet in the installed React types\n inert={captchaIsInteractive ? '' : undefined}\n // `display:none` (not `visibility:hidden`) so the collapsed column leaves flex flow and\n // contributes no `gap` gutter to `Card.Content` — otherwise it injects empty space above\n // the spotlighted captcha. Subtree stays mounted (form state preserved); `inert` is then\n // redundant-but-harmless.\n sx={captchaIsInteractive ? { display: 'none' } : undefined}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {(showOauthProviders || showWeb3Providers || showAlternativePhoneCodeProviders) && (\n <SignUpSocialButtons\n enableOAuthProviders={showOauthProviders}\n enableWeb3Providers={showWeb3Providers}\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n continueSignUp={missingRequirementsWithTicket}\n legalAccepted={Boolean(formState.legalAccepted.checked) || undefined}\n />\n )}\n {shouldShowForm && (\n <SignUpForm\n handleSubmit={handleSubmit}\n fields={fields}\n formState={formState}\n canToggleEmailPhone={canToggleEmailPhone}\n handleEmailPhoneToggle={handleChangeActive}\n />\n )}\n </SocialButtonsReversibleContainerWithDivider>\n </Flex>\n <CaptchaElement\n gapless\n onInteractiveChange={setCaptchaIsInteractive}\n />\n </Card.Content>\n\n <Card.Footer>\n <Card.Action elementId='signUp'>\n <Card.ActionText localizationKey={localizationKeys('signUp.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signUp.start.actionLink')}\n to={isCombinedFlow ? '../' : clerk.buildUrlWithAuth(signInUrl)}\n />\n </Card.Action>\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignUpStartAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleSubmit}\n fields={fields}\n formState={formState}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nexport const SignUpStart = withRedirectToSignUpTask(\n withRedirectToAfterSignUp(withCardStateProvider(SignUpStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,sBAAmC;CAC1C,MAAM,OAAO,aAAa;CAC1B,MAAM,QAAQ,SAAS;CACvB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,cAAc;CAC7B,MAAM,EAAE,uBAAuB,cAAc,CAAC,CAAC;CAC/C,MAAM,EAAE,cAAc,eAAe,eAAe;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,EAAE,eAAe;CACvB,MAAM,EAAE,cAAc,SAAS;CAC/B,MAAM,MAAM,iBA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