diff --git a/apps/remix/app/routes/_h._index.tsx b/apps/remix/app/routes/_h._index.tsx index 0da2508..2439662 100644 --- a/apps/remix/app/routes/_h._index.tsx +++ b/apps/remix/app/routes/_h._index.tsx @@ -92,32 +92,32 @@ export const action: ActionFunction = async ({ request }) => { }); } } else if (_action === "create") { - // const response = formData.get("cf-turnstile-response"); - // if (!response) { - // return { - // error: "No captcha response", - // }; - // } - // const verifyEndpoint = - // "https://challenges.cloudflare.com/turnstile/v0/siteverify"; - // const secret = - // process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA"; - // const resp = await fetch(verifyEndpoint, { - // method: "POST", - // body: JSON.stringify({ - // secret, - // response, - // }), - // headers: { - // "Content-Type": "application/json", - // }, - // }); - // const data = await resp.json(); - // if (!data.success) { - // return { - // error: "Failed to verify captcha", - // }; - // } + const response = formData.get("cf-turnstile-response"); + if (!response) { + return { + error: "No captcha response", + }; + } + const verifyEndpoint = + "https://challenges.cloudflare.com/turnstile/v0/siteverify"; + const secret = + process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA"; + const resp = await fetch(verifyEndpoint, { + method: "POST", + body: JSON.stringify({ + secret, + response, + }), + headers: { + "Content-Type": "application/json", + }, + }); + const data = await resp.json(); + if (!data.success) { + return { + error: "Failed to verify captcha", + }; + } const domain = process.env.EMAIL_DOMAIN || ""; if (!domain) {