From b64f0bacac0e646c05b2b96e07d600867267c021 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 15 Dec 2025 12:28:31 -0800 Subject: [PATCH] Refactor: Switch signin to Turnstile verification --- functions/api/signin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/api/signin.js b/functions/api/signin.js index 5c5c1a3..50854ad 100644 --- a/functions/api/signin.js +++ b/functions/api/signin.js @@ -13,13 +13,13 @@ const ntfy = (env,title,msg,p=3) => export async function onRequestPost({ request, env }) { try { - const { "g-recaptcha-response":token, ...body } = await request.json(); + const { "cf-turnstile-response":token, ...body } = await request.json(); const vR = await fetch( - "https://www.google.com/recaptcha/api/siteverify", + "https://challenges.cloudflare.com/turnstile/v0/siteverify", { method:"POST", - headers:{ "Content-Type":"application/x-www-form-urlencoded" }, - body:`secret=${env.RECAPCHA_KEY}&response=${token}` + headers:{ "Content-Type":"application/json" }, + body:JSON.stringify({ secret:env.TURNSTILE_KEY, response:token }) } ); if (!(await vR.json()).success)