From 41da04d68150df26867095d7f59f2c6b982291fe Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sun, 29 Jun 2025 18:41:02 +0900 Subject: [PATCH] Remove hCaptcha verification from contact API route --- frontend/app/api/contact/route.ts | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/frontend/app/api/contact/route.ts b/frontend/app/api/contact/route.ts index 0c4688a..61a2d60 100644 --- a/frontend/app/api/contact/route.ts +++ b/frontend/app/api/contact/route.ts @@ -22,24 +22,24 @@ export async function POST(req: NextRequest) { } // Step 1: Verify hCaptcha token - const verifyResponse = await fetch('https://api.hcaptcha.com/siteverify', { - method: 'POST', - headers: {'Content-Type': 'application/x-www-form-urlencoded'}, - body: new URLSearchParams({ - secret: HCAPTCHA_SECRET, - response: captchaToken, - }), - }) + // const verifyResponse = await fetch('https://api.hcaptcha.com/siteverify', { + // method: 'POST', + // headers: {'Content-Type': 'application/x-www-form-urlencoded'}, + // body: new URLSearchParams({ + // secret: HCAPTCHA_SECRET, + // response: captchaToken, + // }), + // }) + // + // const captchaResult = await verifyResponse.json() + // console.log('[ContactAPI] hCaptcha result:', captchaResult) - const captchaResult = await verifyResponse.json() - console.log('[ContactAPI] hCaptcha result:', captchaResult) - - if (!captchaResult.success) { - return NextResponse.json( - {success: false, error: 'Captcha verification failed'}, - {status: 403} - ) - } + // if (!captchaResult.success) { + // return NextResponse.json( + // {success: false, error: 'Captcha verification failed'}, + // {status: 403} + // ) + // } // Step 2: Forward to backend service const backendRes = await fetch(`${gatewayHost}/api/contact`, {