-
Notifications
You must be signed in to change notification settings - Fork 513
re-enable posthog recordings #1404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,14 +14,12 @@ export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; | |
| const postHogKey = getPublicEnvVar('NEXT_PUBLIC_POSTHOG_KEY') ?? "phc_vIUFi0HzHo7oV26OsaZbUASqxvs8qOmap1UBYAutU4k"; | ||
| if (postHogKey.length > 5) { | ||
| posthog.init(postHogKey, { | ||
| // We use Sentry's Replay integration below for error debugging. Keep | ||
| // PostHog session recording off to avoid loading its lazy recorder, which | ||
| // is the source of Sentry issue STACK-SERVER-1NK: | ||
| // "Called on script loaded before session recording is available". | ||
| // PostHog documents `disable_session_recording: true` as the config-level | ||
| // way to prevent automatic web session recording. | ||
| // Source: https://posthog.com/docs/session-replay/how-to-control-which-sessions-you-record | ||
| disable_session_recording: true, | ||
| session_recording: { | ||
| maskAllInputs: false, | ||
| maskInputOptions: { | ||
| password: true, | ||
| }, | ||
| }, | ||
|
Comment on lines
+17
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The previous Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/instrumentation-client.ts
Line: 17-22
Comment:
**Known Sentry issue may resurface**
The previous `disable_session_recording: true` was explicitly added to prevent Sentry issue STACK-SERVER-1NK ("Called on script loaded before session recording is available"). Re-enabling session recording without addressing the root cause of that race condition means the same issue is likely to reappear. The new `session_recording` config block does not mitigate the timing problem that triggered the original bug — it only configures what gets masked.
How can I resolve this? If you propose a fix, please make it concise.
Comment on lines
+17
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/instrumentation-client.ts
Line: 17-22
Comment:
**Sensitive non-password inputs will be captured in recordings**
With `maskAllInputs: false`, PostHog will record keystrokes in every input except `type="password"` fields. In the Stack Auth dashboard, users routinely enter OAuth client secrets, webhook signing secrets, API keys, and TOTP/OTP codes — none of which use `type="password"`. These values would be captured in session recordings and accessible to anyone with access to the PostHog project. Consider either setting `maskAllInputs: true` and selectively unmasking safe fields, or ensuring every sensitive input in the dashboard carries a `data-ph-no-capture` attribute.
How can I resolve this? If you propose a fix, please make it concise.
Comment on lines
+17
to
+22
|
||
| defaults: '2025-11-30', | ||
| api_host: "/consume", | ||
| ui_host: "https://eu.i.posthog.com", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Verification inconclusive
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 2
stderr:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
# Check the DESIGN-GUIDE.md for any guidance on session recording or privacy cat apps/dashboard/DESIGN-GUIDE.mdRepository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
# Check git history to understand the context of this change git log --oneline -n 30 -- apps/dashboard/instrumentation-client.tsRepository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stderr:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
stdout:
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
Script executed:
Repository: stack-auth/stack-auth
Repository: stack-auth/stack-auth
Exit code: 0
Verify this intentional exposure is covered by privacy/compliance documentation.
maskAllInputs: falseleaves non-password form inputs visible in session replay (emails, names, tokens, API keys, and other PII). Documentation explicitly warns against this unless there is a documented data-handling policy. Confirm this change is intentional and add a code comment explaining the compliance rationale and any required consent mechanisms.🤖 Prompt for AI Agents