fix(posthog): prevent redirects by whitelisting ingest route (#1615)

This commit is contained in:
Vikhyath Mondreti
2025-10-13 11:08:48 -07:00
committed by GitHub
parent 4937d72d70
commit ec73e2e9ce
2 changed files with 12 additions and 9 deletions

View File

@@ -17,8 +17,8 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
defaults: '2025-05-24',
person_profiles: 'identified_only',
capture_pageview: true,
capture_pageleave: true,
capture_performance: true,
capture_pageleave: false,
capture_performance: false,
session_recording: {
maskAllInputs: false,
maskInputOptions: {
@@ -26,13 +26,16 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
email: false,
},
recordCrossOriginIframes: false,
recordHeaders: true,
recordBody: true,
recordHeaders: false,
recordBody: false,
},
autocapture: true,
capture_dead_clicks: true,
autocapture: {
dom_event_allowlist: ['click', 'submit', 'change'],
element_allowlist: ['button', 'a', 'input'],
},
capture_dead_clicks: false,
persistence: 'localStorage+cookie',
enable_heatmaps: true,
enable_heatmaps: false,
})
}
}, [])

View File

@@ -220,13 +220,13 @@ const nextConfig: NextConfig = {
if (isHosted) {
redirects.push(
{
source: '/((?!api|_next|_vercel|favicon|static|.*\\..*).*)',
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
destination: 'https://www.sim.ai/$1',
permanent: true,
has: [{ type: 'host' as const, value: 'simstudio.ai' }],
},
{
source: '/((?!api|_next|_vercel|favicon|static|.*\\..*).*)',
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
destination: 'https://www.sim.ai/$1',
permanent: true,
has: [{ type: 'host' as const, value: 'www.simstudio.ai' }],