mirror of
https://github.com/Such-Software/xmrcheckout.git
synced 2026-10-17 05:51:34 +02:00
Add OPEN_REGISTRATION gate, signup request form, favicon
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export async function verifyTurnstile(token: string) {
|
||||
const secretKey = process.env.TURNSTILE_SECRET_KEY;
|
||||
if (!secretKey) {
|
||||
console.warn("No TURNSTILE_SECRET_KEY set, skipping verification");
|
||||
return true;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("secret", secretKey);
|
||||
formData.append("response", token);
|
||||
|
||||
const res = await fetch(
|
||||
"https://challenges.cloudflare.com/turnstile/v0/siteverify",
|
||||
{ method: "POST", body: formData }
|
||||
);
|
||||
|
||||
const data = await res.json();
|
||||
return data.success;
|
||||
}
|
||||
Reference in New Issue
Block a user