Add OPEN_REGISTRATION gate, signup request form, favicon

This commit is contained in:
jwinterm
2026-03-09 13:02:21 -04:00
parent 408312cce7
commit 3eabad598d
15 changed files with 366 additions and 0 deletions
+19
View File
@@ -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;
}