Skip to content

Commit 0f602f7

Browse files
TheodoreSpeaksTheodore Li
andauthored
fix(login): fix captcha headers for manual login (#4025)
* fix(signup): fix turnstile key loading * fix(login): fix captcha header passing * Catch user already exists, remove login form captcha --------- Co-authored-by: Theodore Li <theo@sim.ai>
1 parent d0d3581 commit 0f602f7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

apps/sim/app/(auth)/signup/signup-form.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,8 @@ function SignupFormContent({
270270
name: sanitizedName,
271271
},
272272
{
273-
fetchOptions: {
274-
headers: {
275-
...(token ? { 'x-captcha-response': token } : {}),
276-
},
273+
headers: {
274+
...(token ? { 'x-captcha-response': token } : {}),
277275
},
278276
onError: (ctx) => {
279277
logger.error('Signup error:', ctx.error)
@@ -282,10 +280,7 @@ function SignupFormContent({
282280
let errorCode = 'unknown'
283281
if (ctx.error.code?.includes('USER_ALREADY_EXISTS')) {
284282
errorCode = 'user_already_exists'
285-
errorMessage.push(
286-
'An account with this email already exists. Please sign in instead.'
287-
)
288-
setEmailError(errorMessage[0])
283+
setEmailError('An account with this email already exists. Please sign in instead.')
289284
} else if (
290285
ctx.error.code?.includes('BAD_REQUEST') ||
291286
ctx.error.message?.includes('Email and password sign up is not enabled')

0 commit comments

Comments
 (0)