Summary
src/app/api/revalidate/route.ts defines WEBHOOK_SECRET as a fallback string literal that ships with the source code.
Affected area
src/app/api/revalidate/route.ts line 7: const WEBHOOK_SECRET = process.env.REVALIDATE_WEBHOOK_SECRET || 'your-webhook-secret';
Steps to reproduce / impact
If the env var is misconfigured or absent in production, the route will silently accept all requests signed with the literal default string. This renders the HMAC verification useless and opens the revalidation endpoint to spoofing.
Expected behaviour
Throw at startup if REVALIDATE_WEBHOOK_SECRET is missing in production. Provide a clear error message to developers running locally.
Acceptance criteria
Summary
src/app/api/revalidate/route.tsdefinesWEBHOOK_SECRETas a fallback string literal that ships with the source code.Affected area
src/app/api/revalidate/route.tsline 7:const WEBHOOK_SECRET = process.env.REVALIDATE_WEBHOOK_SECRET || 'your-webhook-secret';Steps to reproduce / impact
If the env var is misconfigured or absent in production, the route will silently accept all requests signed with the literal default string. This renders the HMAC verification useless and opens the revalidation endpoint to spoofing.
Expected behaviour
Throw at startup if
REVALIDATE_WEBHOOK_SECRETis missing in production. Provide a clear error message to developers running locally.Acceptance criteria
.env.exampleandREADME.md.