Skip to content

improvement(redirects): move redirects to middleware, push to login if no session and workspace if session exists, remove telemetry consent dialog#976

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/redirects
Aug 15, 2025
Merged

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • move redirects to middleware, push to login if no session and workspace if session exists
  • remove telemetry consent dialog

Type of Change

  • Other: Improvement

Testing

Tested manually, incognito browser to make sure I can't access the homepage.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Aug 15, 2025 7:42pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 15, 2025 7:42pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR implements two major architectural improvements to enhance the user experience on self-hosted deployments:

1. Middleware-based Authentication Redirects: The redirect logic has been moved from Next.js config to middleware, implementing intelligent session-aware routing. For self-hosted deployments (isHosted = false), the root path now redirects authenticated users directly to /workspace and unauthenticated users to /login, bypassing the landing page entirely. This creates a streamlined experience for private/enterprise deployments where marketing content is unnecessary.

2. Telemetry Consent Dialog Removal: The entire telemetry consent workflow has been eliminated, including:

  • Removal of the TelemetryConsentDialog component from the root layout
  • Database migration to drop the telemetry_notified_user column from the settings table
  • Cleanup of telemetry notification tracking from the general settings store and API endpoints
  • Updated TypeScript interfaces to remove consent-related properties

The changes maintain core telemetry functionality (users can still enable/disable in settings) while removing the consent dialog that previously interrupted the user onboarding flow. The middleware approach provides better performance by handling redirects before React components render, and centralizes authentication logic in a more appropriate architectural layer.

Confidence score: 3/5

  • This PR requires careful review due to significant changes in authentication flow and privacy consent handling
  • Score reflects concerns about removing user consent mechanisms for telemetry collection, which may impact privacy compliance
  • Pay close attention to middleware.ts, the database migration files, and the removed telemetry consent dialog functionality

14 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel vercel Bot temporarily deployed to Preview – docs August 15, 2025 19:33 Inactive
@waleedlatif1 waleedlatif1 merged commit 5861388 into staging Aug 15, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/redirects branch August 15, 2025 19:36
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…f no session and workspace if session exists, remove telemetry consent dialog (simstudioai#976)

* improvement(redirects): move redirects to middleware, push to login if no session and workspace if session exists

* remove telemetry consent dialog

* remove migrations

* rerun migrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant