fix: show captcha when turnstile is enabled only

This commit is contained in:
javayhu 2025-06-30 23:05:38 +08:00
parent ba3cbe0724
commit 111568d746

View File

@ -230,10 +230,12 @@ export const RegisterForm = ({
</div>
<FormError message={error} />
<FormSuccess message={success} />
<Captcha
onSuccess={(token) => form.setValue('captchaToken', token)}
validationError={form.formState.errors.captchaToken?.message}
/>
{turnstileEnabled && (
<Captcha
onSuccess={(token) => form.setValue('captchaToken', token)}
validationError={form.formState.errors.captchaToken?.message}
/>
)}
<Button
disabled={isPending || (turnstileEnabled && !captchaToken)}
size="lg"