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>
This commit is contained in:
Theodore Li
2026-04-07 15:32:33 -07:00
committed by GitHub
parent d0d3581605
commit 0f602f79a4

View File

@@ -270,10 +270,8 @@ function SignupFormContent({
name: sanitizedName,
},
{
fetchOptions: {
headers: {
...(token ? { 'x-captcha-response': token } : {}),
},
headers: {
...(token ? { 'x-captcha-response': token } : {}),
},
onError: (ctx) => {
logger.error('Signup error:', ctx.error)
@@ -282,10 +280,7 @@ function SignupFormContent({
let errorCode = 'unknown'
if (ctx.error.code?.includes('USER_ALREADY_EXISTS')) {
errorCode = 'user_already_exists'
errorMessage.push(
'An account with this email already exists. Please sign in instead.'
)
setEmailError(errorMessage[0])
setEmailError('An account with this email already exists. Please sign in instead.')
} else if (
ctx.error.code?.includes('BAD_REQUEST') ||
ctx.error.message?.includes('Email and password sign up is not enabled')