fix(config): update hostname for API and add Google Analytics endpoints to CSP
This commit is contained in:
@@ -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 }) {
|
||||
/>
|
||||
</head>
|
||||
<ThemeRegistry>
|
||||
{process.env.DEV_MODE === 'FALSE' && (
|
||||
<GoogleTagManager gtmId="GTM-NXBSV7GS" />
|
||||
)}
|
||||
<body className="bg-[#FAFAFA]">
|
||||
<ProvinceProvider>
|
||||
<Providers>{children}</Providers>
|
||||
|
||||
+8
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user