From 09373c46d6a5e8ab319f7afa1c101a92302d1b3b Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Thu, 25 Jun 2026 20:52:09 +0330 Subject: [PATCH] fix(config): update hostname for API and add Google Analytics endpoints to CSP --- app/layout.js | 4 ---- next.config.js | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/layout.js b/app/layout.js index 3ff6124..84c03c5 100644 --- a/app/layout.js +++ b/app/layout.js @@ -2,7 +2,6 @@ import "./globals.css"; import ThemeRegistry from "./component/ThemeRegistry"; import { Providers } from "./Providers"; import { GoogleAnalytics } from "@next/third-parties/google"; -import { GoogleTagManager } from "@next/third-parties/google"; import "react-toastify/dist/ReactToastify.css"; import CustomToastify from "./CustomToastify"; import { ProvinceProvider } from "@/context/ProvinceProvider"; @@ -112,9 +111,6 @@ export default async function RootLayout({ children }) { /> - {process.env.DEV_MODE === 'FALSE' && ( - - )} {children} diff --git a/next.config.js b/next.config.js index e70fc46..6395571 100644 --- a/next.config.js +++ b/next.config.js @@ -10,7 +10,7 @@ const nextConfig = { }, { protocol: 'http', - hostname: 'api.clinic-pro.ir', + hostname: 'clinic-pro.ir', }, { protocol: 'https', @@ -55,6 +55,12 @@ const nextConfig = { 'https://clinic-pro.ir', 'https://back-dev.clinic-pro.ir', 'http://clinic-pro.ddev.site', + // Google Analytics / Tag Manager endpoints + 'https://www.google-analytics.com', + 'https://*.google-analytics.com', + 'https://www.googletagmanager.com', + 'https://*.analytics.google.com', + 'https://stats.g.doubleclick.net', ...(isDev ? ['ws:', 'wss:'] : []), ] .filter(Boolean) @@ -63,7 +69,7 @@ const nextConfig = { const csp = [ "default-src 'self'", "img-src 'self' https: data: blob:", - "script-src 'self' 'unsafe-inline' 'unsafe-eval'", + "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.googletagmanager.com https://www.google-analytics.com", "style-src 'self' 'unsafe-inline'", "font-src 'self' data:", 'connect-src ' + connectSrc,