Skip to content

Commit 355509b

Browse files
chore(web): Remove org domain from routes (#1076)
* wip * refactor(web): add authenticatedPage HOC, remove SINGLE_TENANT_ORG_ID 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> * rename prisma to __unsafePrisma * wip * add proxy middleware * fix build failure * improve redemption flow * fix: export __unsafePrisma from prisma mock for tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * changelog --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b7656c3 commit 355509b

File tree

200 files changed

+792
-1047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+792
-1047
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Changed
1414
- Links in Ask Sourcebot chat responses now open in a new tab with a subtle external link icon indicator. [#1059](https://github.com/sourcebot-dev/sourcebot/pull/1059)
15+
- Removed `/~` from the root of most app URLs. [#1076](https://github.com/sourcebot-dev/sourcebot/pull/1076)
1516

1617
## [4.16.7] - 2026-04-03
1718

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `domain` on the `Org` table. All the data in the column will be lost.
5+
6+
*/
7+
-- DropIndex
8+
DROP INDEX "Org_domain_key";
9+
10+
-- AlterTable
11+
ALTER TABLE "Org" DROP COLUMN "domain";

packages/db/prisma/schema.prisma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ model AccountRequest {
265265
model Org {
266266
id Int @id @default(autoincrement())
267267
name String
268-
domain String @unique
269268
createdAt DateTime @default(now())
270269
updatedAt DateTime @updatedAt
271270
members UserToOrg[]

packages/web/src/__mocks__/prisma.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SINGLE_TENANT_ORG_NAME } from '@/lib/constants';
1+
import { SINGLE_TENANT_ORG_ID, SINGLE_TENANT_ORG_NAME } from '@/lib/constants';
22
import { Account, ApiKey, OAuthRefreshToken, OAuthToken, Org, PrismaClient, User } from '@prisma/client';
33
import { beforeEach, vi } from 'vitest';
44
import { mockDeep, mockReset } from 'vitest-mock-extended';
@@ -8,11 +8,11 @@ beforeEach(() => {
88
});
99

1010
export const prisma = mockDeep<PrismaClient>();
11+
export const __unsafePrisma = prisma;
1112

1213
export const MOCK_ORG: Org = {
1314
id: SINGLE_TENANT_ORG_ID,
1415
name: SINGLE_TENANT_ORG_NAME,
15-
domain: SINGLE_TENANT_ORG_DOMAIN,
1616
createdAt: new Date(),
1717
updatedAt: new Date(),
1818
isOnboarded: true,

0 commit comments

Comments
 (0)