Skip to content

Commit ec73e2e

Browse files
fix(posthog): prevent redirects by whitelisting ingest route (#1615)
1 parent 4937d72 commit ec73e2e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

apps/sim/lib/posthog/provider.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,25 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
1717
defaults: '2025-05-24',
1818
person_profiles: 'identified_only',
1919
capture_pageview: true,
20-
capture_pageleave: true,
21-
capture_performance: true,
20+
capture_pageleave: false,
21+
capture_performance: false,
2222
session_recording: {
2323
maskAllInputs: false,
2424
maskInputOptions: {
2525
password: true,
2626
email: false,
2727
},
2828
recordCrossOriginIframes: false,
29-
recordHeaders: true,
30-
recordBody: true,
29+
recordHeaders: false,
30+
recordBody: false,
3131
},
32-
autocapture: true,
33-
capture_dead_clicks: true,
32+
autocapture: {
33+
dom_event_allowlist: ['click', 'submit', 'change'],
34+
element_allowlist: ['button', 'a', 'input'],
35+
},
36+
capture_dead_clicks: false,
3437
persistence: 'localStorage+cookie',
35-
enable_heatmaps: true,
38+
enable_heatmaps: false,
3639
})
3740
}
3841
}, [])

apps/sim/next.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ const nextConfig: NextConfig = {
220220
if (isHosted) {
221221
redirects.push(
222222
{
223-
source: '/((?!api|_next|_vercel|favicon|static|.*\\..*).*)',
223+
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
224224
destination: 'https://www.sim.ai/$1',
225225
permanent: true,
226226
has: [{ type: 'host' as const, value: 'simstudio.ai' }],
227227
},
228228
{
229-
source: '/((?!api|_next|_vercel|favicon|static|.*\\..*).*)',
229+
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
230230
destination: 'https://www.sim.ai/$1',
231231
permanent: true,
232232
has: [{ type: 'host' as const, value: 'www.simstudio.ai' }],

0 commit comments

Comments
 (0)