Non richiedere Turnstile contatti sul form newsletter.
Il footer non ha il widget Turnstile: evita il fallimento usando solo NEWSLETTER_TURNSTILE_SECRET_KEY. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -83,9 +83,9 @@ export const POST: APIRoute = async ({ request, locals, url }) => {
|
||||
}
|
||||
const email = normalizeEmail(emailRaw);
|
||||
|
||||
const turnstileSecret =
|
||||
readEnv('NEWSLETTER_TURNSTILE_SECRET_KEY', runtimeEnv) ||
|
||||
readEnv('CONTACT_TURNSTILE_SECRET_KEY', runtimeEnv);
|
||||
// Turnstile solo se configurato esplicitamente per la newsletter.
|
||||
// Non riusare CONTACT_TURNSTILE_SECRET_KEY: il form footer non ha il widget.
|
||||
const turnstileSecret = readEnv('NEWSLETTER_TURNSTILE_SECRET_KEY', runtimeEnv);
|
||||
if (turnstileSecret) {
|
||||
const turnstileToken = required(form.get('cf-turnstile-response'));
|
||||
const isHuman = await verifyTurnstile(
|
||||
|
||||
Reference in New Issue
Block a user