Remove hCaptcha verification from contact API route

This commit is contained in:
2025-06-29 18:41:02 +09:00
parent d63ff0a170
commit 41da04d681

View File

@@ -22,24 +22,24 @@ export async function POST(req: NextRequest) {
} }
// Step 1: Verify hCaptcha token // Step 1: Verify hCaptcha token
const verifyResponse = await fetch('https://api.hcaptcha.com/siteverify', { // const verifyResponse = await fetch('https://api.hcaptcha.com/siteverify', {
method: 'POST', // method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}, // headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({ // body: new URLSearchParams({
secret: HCAPTCHA_SECRET, // secret: HCAPTCHA_SECRET,
response: captchaToken, // response: captchaToken,
}), // }),
}) // })
//
// const captchaResult = await verifyResponse.json()
// console.log('[ContactAPI] hCaptcha result:', captchaResult)
const captchaResult = await verifyResponse.json() // if (!captchaResult.success) {
console.log('[ContactAPI] hCaptcha result:', captchaResult) // return NextResponse.json(
// {success: false, error: 'Captcha verification failed'},
if (!captchaResult.success) { // {status: 403}
return NextResponse.json( // )
{success: false, error: 'Captcha verification failed'}, // }
{status: 403}
)
}
// Step 2: Forward to backend service // Step 2: Forward to backend service
const backendRes = await fetch(`${gatewayHost}/api/contact`, { const backendRes = await fetch(`${gatewayHost}/api/contact`, {