diff --git a/web-next/app/[locale]/login/LoginForm.tsx b/web-next/app/[locale]/login/LoginForm.tsx
index d96cc6e..9bb5f80 100644
--- a/web-next/app/[locale]/login/LoginForm.tsx
+++ b/web-next/app/[locale]/login/LoginForm.tsx
@@ -3,8 +3,10 @@
import { useState } from 'react'
import { useTranslations } from 'next-intl'
import { useRouter } from '@/i18n/navigation'
+import { Turnstile } from '@/components/Turnstile'
-const ERROR_KEYS = ['invalidCredentials', 'missingFields', 'invalidRequest'] as const
+const ERROR_KEYS = ['invalidCredentials', 'missingFields', 'invalidRequest', 'captchaFailed'] as const
+const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY
export function LoginForm() {
const t = useTranslations('Login')
@@ -13,6 +15,7 @@ export function LoginForm() {
const [password, setPassword] = useState('')
const [showPw, setShowPw] = useState(false)
const [busy, setBusy] = useState(false)
+ const [captcha, setCaptcha] = useState('')
const [message, setMessage] = useState<{ ok: boolean; text: string } | null>(null)
async function handleSubmit(e: React.FormEvent) {
@@ -29,7 +32,7 @@ export function LoginForm() {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
- body: JSON.stringify({ email: email.trim(), password }),
+ body: JSON.stringify({ email: email.trim(), password, turnstileToken: captcha }),
})
const data: { success?: boolean; needsSelection?: boolean; error?: string } = await res.json()
if (data.success) {
@@ -77,9 +80,10 @@ export function LoginForm() {
{showPw ? '🙈' : '👁'}
+