fix: allow mollie.js in CSP, hide app header on checkout page
This commit is contained in:
@@ -91,6 +91,8 @@ function LayoutInner({ children }: { children: React.ReactNode }) {
|
|||||||
const showOfflineBar = Boolean(auth.user && !isOnline)
|
const showOfflineBar = Boolean(auth.user && !isOnline)
|
||||||
// Site pages use DashboardShell with full sidebar — no Header needed
|
// Site pages use DashboardShell with full sidebar — no Header needed
|
||||||
const isSitePage = pathname.startsWith('/sites/') && pathname !== '/sites/new'
|
const isSitePage = pathname.startsWith('/sites/') && pathname !== '/sites/new'
|
||||||
|
// Checkout page has its own minimal layout — no app header/footer
|
||||||
|
const isCheckoutPage = pathname.startsWith('/checkout')
|
||||||
|
|
||||||
if (isSwitchingOrg) {
|
if (isSwitchingOrg) {
|
||||||
return <LoadingOverlay logoSrc="/pulse_icon_no_margins.png" title="Pulse" portal={false} />
|
return <LoadingOverlay logoSrc="/pulse_icon_no_margins.png" title="Pulse" portal={false} />
|
||||||
@@ -113,6 +115,11 @@ function LayoutInner({ children }: { children: React.ReactNode }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checkout page: render children only (has its own layout)
|
||||||
|
if (isAuthenticated && isCheckoutPage) {
|
||||||
|
return <>{children}</>
|
||||||
|
}
|
||||||
|
|
||||||
// Authenticated non-site pages (sites list, onboarding, etc.): static header
|
// Authenticated non-site pages (sites list, onboarding, etc.): static header
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ const withPWA = withPWAInit({
|
|||||||
const cspDirectives = [
|
const cspDirectives = [
|
||||||
"default-src 'self'",
|
"default-src 'self'",
|
||||||
// Next.js requires 'unsafe-inline' for its bootstrap scripts; 'unsafe-eval' only in dev (HMR)
|
// Next.js requires 'unsafe-inline' for its bootstrap scripts; 'unsafe-eval' only in dev (HMR)
|
||||||
`script-src 'self' 'unsafe-inline'${process.env.NODE_ENV === 'development' ? " 'unsafe-eval'" : ''}`,
|
`script-src 'self' 'unsafe-inline' https://js.mollie.com${process.env.NODE_ENV === 'development' ? " 'unsafe-eval'" : ''}`,
|
||||||
"style-src 'self' 'unsafe-inline'",
|
"style-src 'self' 'unsafe-inline'",
|
||||||
"img-src 'self' data: blob: https://www.google.com https://*.gstatic.com https://ciphera.net",
|
"img-src 'self' data: blob: https://www.google.com https://*.gstatic.com https://ciphera.net",
|
||||||
"font-src 'self'",
|
"font-src 'self'",
|
||||||
`connect-src 'self' https://*.ciphera.net https://ciphera.net https://www.google.com https://*.gstatic.com https://cdn.jsdelivr.net${process.env.NODE_ENV === 'development' ? ' http://localhost:*' : ''}`,
|
`connect-src 'self' https://*.ciphera.net https://ciphera.net https://www.google.com https://*.gstatic.com https://cdn.jsdelivr.net https://*.mollie.com${process.env.NODE_ENV === 'development' ? ' http://localhost:*' : ''}`,
|
||||||
"worker-src 'self' blob:",
|
"worker-src 'self' blob:",
|
||||||
"frame-src 'none'",
|
"frame-src https://*.mollie.com",
|
||||||
"object-src 'none'",
|
"object-src 'none'",
|
||||||
"base-uri 'self'",
|
"base-uri 'self'",
|
||||||
"form-action 'self' https://*.ciphera.net",
|
"form-action 'self' https://*.ciphera.net",
|
||||||
|
|||||||
Reference in New Issue
Block a user