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 ThemeRegistry from "./component/ThemeRegistry";
|
||||||
import { Providers } from "./Providers";
|
import { Providers } from "./Providers";
|
||||||
import { GoogleAnalytics } from "@next/third-parties/google";
|
import { GoogleAnalytics } from "@next/third-parties/google";
|
||||||
import { GoogleTagManager } from "@next/third-parties/google";
|
|
||||||
import "react-toastify/dist/ReactToastify.css";
|
import "react-toastify/dist/ReactToastify.css";
|
||||||
import CustomToastify from "./CustomToastify";
|
import CustomToastify from "./CustomToastify";
|
||||||
import { ProvinceProvider } from "@/context/ProvinceProvider";
|
import { ProvinceProvider } from "@/context/ProvinceProvider";
|
||||||
@@ -112,9 +111,6 @@ export default async function RootLayout({ children }) {
|
|||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<ThemeRegistry>
|
<ThemeRegistry>
|
||||||
{process.env.DEV_MODE === 'FALSE' && (
|
|
||||||
<GoogleTagManager gtmId="GTM-NXBSV7GS" />
|
|
||||||
)}
|
|
||||||
<body className="bg-[#FAFAFA]">
|
<body className="bg-[#FAFAFA]">
|
||||||
<ProvinceProvider>
|
<ProvinceProvider>
|
||||||
<Providers>{children}</Providers>
|
<Providers>{children}</Providers>
|
||||||
|
|||||||
+8
-2
@@ -10,7 +10,7 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
hostname: 'api.clinic-pro.ir',
|
hostname: 'clinic-pro.ir',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
@@ -55,6 +55,12 @@ const nextConfig = {
|
|||||||
'https://clinic-pro.ir',
|
'https://clinic-pro.ir',
|
||||||
'https://back-dev.clinic-pro.ir',
|
'https://back-dev.clinic-pro.ir',
|
||||||
'http://clinic-pro.ddev.site',
|
'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:'] : []),
|
...(isDev ? ['ws:', 'wss:'] : []),
|
||||||
]
|
]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
@@ -63,7 +69,7 @@ const nextConfig = {
|
|||||||
const csp = [
|
const csp = [
|
||||||
"default-src 'self'",
|
"default-src 'self'",
|
||||||
"img-src 'self' https: data: blob:",
|
"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'",
|
"style-src 'self' 'unsafe-inline'",
|
||||||
"font-src 'self' data:",
|
"font-src 'self' data:",
|
||||||
'connect-src ' + connectSrc,
|
'connect-src ' + connectSrc,
|
||||||
|
|||||||
Reference in New Issue
Block a user