Merge claude/consent-banner-first-paint-154f9f: the cookie banner is part of the first render
Conflicts in the docs only, both sides kept: changelog lines, AGENT.md checklist rows 12 (banner) and 13 (wrapper order), the two iapl-upgrade blocks, PROGRAMISTA rows 76 (client hints) and 77 (banner, renumbered from 76). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+2
-1
@@ -224,7 +224,7 @@ export const proxy = createProxy(i18nConfig, {
|
||||
// app/(frontend)/[locale]/layout.tsx
|
||||
import { headers } from 'next/headers'
|
||||
const nonce = (await headers()).get('x-nonce') // CSP_NONCE_HEADER
|
||||
<SiteProviders shell={shell} theme nonce={nonce}>… // ThemeScript + GA4/GTM tag get the nonce
|
||||
<SiteProviders shell={shell} theme nonce={nonce}>… // ThemeScript, the banner's first-paint script + GA4/GTM tag get the nonce
|
||||
```
|
||||
|
||||
Costs and rules:
|
||||
@@ -236,6 +236,7 @@ Costs and rules:
|
||||
- Your own proxy: `createCspNonce()` + `buildCsp({ nonce })`, set the policy on the request headers
|
||||
(`NextResponse.next({ request: { headers } })`) and on the response, like `createProxy` does.
|
||||
- `ConsentScript nonce`, `ThemeScript nonce`, `Analytics nonce` exist for policies without `'strict-dynamic'`.
|
||||
- The cookie banner's first-paint script (consent.md → "First paint") is inline, so under a nonce policy it needs the nonce with or without `'strict-dynamic'`: `SiteProviders nonce` passes it (`ConsentProvider nonce` / `CookieBanner nonce` by hand). Refused, the banner appears after hydration.
|
||||
|
||||
### Payload admin — its own, looser policy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user