chore(web): Remove org domain from routes#1076
Merged
brendan-kellam merged 11 commits intomainfrom Apr 4, 2026
Merged
Conversation
Contributor
|
Important Review skippedToo many files! This PR contains 200 files, which is 50 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (200)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… from settings pages Introduces `authenticatedPage` HOC in `middleware/authenticatedPage.tsx` for server component pages. It resolves the auth context (user, org, role, prisma) and optionally gates by role, replacing the manual org-lookup-and-role-check boilerplate in settings pages. Migrates all settings pages to use authenticatedPage, removing direct references to SINGLE_TENANT_ORG_ID from within the (app) route group. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Summary
As part of our original SaaS effort in April 2025, we introduced
multi-tenancy into Sourcebot as part of v3.0.0. Organizations
(or tenants) were assigned a domain suffix that would be appended
as the root part of the URL (e.g.,
https://sourcebot.dev/org-a/...)allowing us to identify what the current organization context was.
For self-hosted instances, multi-tenancy was irrelevant, and so the
domain suffix was simple
~for the single-tenant org.In v4.0.0, we scrapped multi-tenancy, but we were left with the
~in the URL pathname. In this PR, we remove the org domainprefix from the URL pathname and shifted all routes to be served
at the root domain.
Claude Summary
Removes the
[domain]dynamic route segment from the URL structure. Previously, all app routes were nested underapp/[domain]/(e.g.,/~/search,/~/settings), a leftover from when multi-tenancy was supported. This PR eliminates the~from all URLs.app/[domain]/intoapp/(app)/, a Next.js route group that preserves the layout guard without affecting URLs. Routes are now/search,/settings,/chat, etc.getOrgFromDomain(domain)calls with direct lookups usingSINGLE_TENANT_ORG_ID. RemovedgetOrgFromDomainanddata/org.tsentirely.domaincolumn from theOrgmodel and removedSINGLE_TENANT_ORG_DOMAINconstant.app/api/[domain]/repos/[repoId]/image/toapp/api/repos/[repoId]/image/.useDomainhook. Removed domain from all URL construction, component props, query keys, email templates, and form fields.createAccountRequest,getMemberApprovalRequired,getAnonymousAccessStatus,orgHasAvailability, andcreateGuestUserto no longer accept adomainparameter.🤖 Generated with Claude Code