diff --git a/next.config.ts b/next.config.ts index 1e74693..7ef8435 100644 --- a/next.config.ts +++ b/next.config.ts @@ -10,12 +10,16 @@ const nextConfig: NextConfig = { headers: [ { key: "Content-Security-Policy", - // ponytail: restrictive CSP — 'unsafe-inline' for styles only - // because Next.js injects inline styles. No unsafe-inline for - // scripts. Upgrade path: nonces once Next supports them per-route. + // ponytail: Next.js App Router injects inline scripts (RSC flight + // data + bootstrap) to hydrate client components. Without + // 'unsafe-inline' or a nonce in script-src the browser blocks them, + // hydration never runs, and every client form (login, registration, + // reset) falls back to a native GET submit. 'unsafe-inline' for + // scripts is the pragmatic fix; upgrade path is per-request nonces + // via middleware (Next attaches the nonce to its inline scripts). value: [ "default-src 'self'", - "script-src 'self'", + "script-src 'self' 'unsafe-inline'", "style-src 'self' 'unsafe-inline'", "img-src 'self' data:", "font-src 'self'",