Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stale-boxes-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Use a new signUp attempt on SignUp component when there is no ticket flow and a phone number is provided to prevent rate-limiting issues.
2 changes: 1 addition & 1 deletion packages/clerk-js/bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{ "path": "./dist/organizationswitcher*.js", "maxSize": "5KB" },
{ "path": "./dist/organizationlist*.js", "maxSize": "5.5KB" },
{ "path": "./dist/signin*.js", "maxSize": "12.4KB" },
{ "path": "./dist/signup*.js", "maxSize": "6.57KB" },
{ "path": "./dist/signup*.js", "maxSize": "6.6KB" },
{ "path": "./dist/userbutton*.js", "maxSize": "5KB" },
{ "path": "./dist/userprofile*.js", "maxSize": "15KB" },
{ "path": "./dist/userverification*.js", "maxSize": "5KB" },
Expand Down
11 changes: 9 additions & 2 deletions packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useClerk } from '@clerk/shared/react';
import type { SignUpResource } from '@clerk/types';
import React from 'react';

import { ERROR_CODES, SIGN_UP_MODES } from '../../../core/constants';
Expand Down Expand Up @@ -242,8 +243,14 @@ function SignUpStartInternal(): JSX.Element {
const redirectUrl = ctx.ssoCallbackUrl;
const redirectUrlComplete = ctx.afterSignUpUrl || '/';

return signUp
.upsert(buildRequest(fieldsToSubmit))
let signUpAttempt: Promise<SignUpResource>;
if (!fields.ticket) {
signUpAttempt = signUp.create(buildRequest(fieldsToSubmit));
} else {
signUpAttempt = signUp.upsert(buildRequest(fieldsToSubmit));
}

return signUpAttempt
.then(res =>
completeSignUpFlow({
signUp: res,
Expand Down