From 1137b38698dd3d4e451acf81711db47e20f77bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1muel=20Fekete?= Date: Fri, 13 Dec 2024 22:07:06 +0100 Subject: [PATCH 1/7] feat: some best practices and security fixes --- next.config.js | 1 + src/app/layout.tsx | 4 +- .../Accordions/AccordionBoxItems.tsx | 9 ++++ .../Analytics/CookieConsentPopup.tsx | 1 + src/middleware.ts | 52 +++++++++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/middleware.ts diff --git a/next.config.js b/next.config.js index fbffc9ab..9bc30202 100644 --- a/next.config.js +++ b/next.config.js @@ -11,6 +11,7 @@ const nextConfig = { return config; }, cacheHandler: require.resolve('next/dist/server/lib/incremental-cache/file-system-cache.js'), + productionBrowserSourceMaps: true, }; module.exports = nextConfig; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a451d39b..b349236e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,6 +2,7 @@ import '@/styles/globals.css'; import clsx from 'clsx'; import { Metadata, Viewport } from 'next'; +import { headers } from 'next/headers'; import Script from 'next/script'; import { CookieConsentPopup } from '@/components/Analytics/CookieConsentPopup'; @@ -39,10 +40,11 @@ export const viewport: Viewport = { }; export default function RootLayout({ children }: { children: React.ReactNode }) { + const nonce = headers().get('x-nonce'); return ( -