Security: - Replace raw password cookie with HMAC-derived session token + constant-time compare - Add rate limiting (5 attempts / 15 min) to admin login - Atomic JSON writes via file-utils to prevent corruption on crash - Tighten CSP headers; add Square CDN to style-src and font-src - WebP conversion + 20 MB limit on admin image uploads Checkout reliability: - Delayed capture flow: pre-auth → calendar write → capture (never charge without booking) - Derive payment idempotency key from SHA-256(nonce) to prevent nonce/key mismatch on retry - Idempotency key persisted in localStorage; auto-retry on network failure - Idempotent CalDAV writes using orderId-based UIDs; treat 412 as success - User-friendly Square error messages instead of raw API detail strings UX: - Welcome modal + 5-step guided tour with spotlight and scroll-into-view - Balloon release agreement checkbox required before payment - 24-hour lead time enforced server-side in both delivery and pickup slot generators - Fix Square card form race condition with double-rAF before attach() - Tour hides Bulma modal-background for bright, unobscured modal steps Notifications: - Improved SMTP error logging; re-throw on failure so callers see it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
2.1 KiB
JavaScript
43 lines
2.1 KiB
JavaScript
const isDev = process.env.NODE_ENV === 'development'
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: 'standalone',
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: 'items-images-production.s3.us-west-2.amazonaws.com' },
|
|
{ protocol: 'https', hostname: 'items-images-sandbox.s3.us-west-2.amazonaws.com' },
|
|
{ protocol: 'https', hostname: 'square-web-sdk-production.squarecdn.com' },
|
|
{ protocol: 'https', hostname: 'square-web-sdk-sandbox.squarecdn.com' },
|
|
],
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/(.*)',
|
|
headers: [
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
{ key: 'X-XSS-Protection', value: '1; mode=block' },
|
|
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
|
|
{
|
|
key: 'Content-Security-Policy',
|
|
value: [
|
|
"default-src 'self'",
|
|
`script-src 'self' 'unsafe-inline'${isDev ? " 'unsafe-eval'" : ''} https://web.squarecdn.com https://sandbox.web.squarecdn.com https://cdnjs.cloudflare.com`,
|
|
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdnjs.cloudflare.com https://web.squarecdn.com https://sandbox.web.squarecdn.com",
|
|
"font-src 'self' https://fonts.gstatic.com https://cdnjs.cloudflare.com https://cash-f.squarecdn.com",
|
|
"img-src 'self' data: https://items-images-production.s3.us-west-2.amazonaws.com https://items-images-sandbox.s3.us-west-2.amazonaws.com https://*.squarecdn.com",
|
|
"connect-src 'self' https://web.squarecdn.com https://sandbox.web.squarecdn.com https://pci-connect.squareup.com https://pci-connect.squareupsandbox.com",
|
|
"frame-src https://web.squarecdn.com https://sandbox.web.squarecdn.com",
|
|
].join('; '),
|
|
},
|
|
],
|
|
},
|
|
]
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|