2 Commits

Author SHA1 Message Date
8a99290209 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>
2026-07-29 14:39:52 +02:00
c04d43d9d7 Merge pull request #15 from javaxman/fix/astro6-cloudflare-workers-env
Fix env Cloudflare per Astro 6 (contatti e newsletter)
2026-07-29 14:08:25 +02:00

View File

@ -83,9 +83,9 @@ export const POST: APIRoute = async ({ request, locals, url }) => {
} }
const email = normalizeEmail(emailRaw); const email = normalizeEmail(emailRaw);
const turnstileSecret = // Turnstile solo se configurato esplicitamente per la newsletter.
readEnv('NEWSLETTER_TURNSTILE_SECRET_KEY', runtimeEnv) || // Non riusare CONTACT_TURNSTILE_SECRET_KEY: il form footer non ha il widget.
readEnv('CONTACT_TURNSTILE_SECRET_KEY', runtimeEnv); const turnstileSecret = readEnv('NEWSLETTER_TURNSTILE_SECRET_KEY', runtimeEnv);
if (turnstileSecret) { if (turnstileSecret) {
const turnstileToken = required(form.get('cf-turnstile-response')); const turnstileToken = required(form.get('cf-turnstile-response'));
const isHuman = await verifyTurnstile( const isHuman = await verifyTurnstile(