Skip to content

Commit 0568b03

Browse files
fix: hide license settings in cloud environments
1 parent 60a3528 commit 0568b03

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/web/src/app/[domain]/settings/layout.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { getMe, getOrgAccountRequests } from "@/actions";
1111
import { ServiceErrorException } from "@/lib/serviceError";
1212
import { getOrgFromDomain } from "@/data/org";
1313
import { OrgRole } from "@prisma/client";
14+
import { env } from "@/env.mjs";
1415

1516
export const metadata: Metadata = {
1617
title: "Settings",
@@ -84,10 +85,12 @@ export default async function SettingsLayout({
8485
title: "API Keys",
8586
href: `/${domain}/settings/apiKeys`,
8687
},
87-
{
88-
title: "License",
89-
href: `/${domain}/settings/license`,
90-
}
88+
...(env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === undefined ? [
89+
{
90+
title: "License",
91+
href: `/${domain}/settings/license`,
92+
}
93+
] : []),
9194
]
9295

9396
return (

packages/web/src/app/[domain]/settings/license/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { Button } from "@/components/ui/button";
33
import { Info, Mail } from "lucide-react";
44
import { getOrgMembers } from "@/actions";
55
import { isServiceError } from "@/lib/utils";
6-
import { ServiceErrorException } from "@/lib/serviceError";
6+
import { notFound, ServiceErrorException } from "@/lib/serviceError";
7+
import { env } from "@/env.mjs";
78

89
interface LicensePageProps {
910
params: {
@@ -12,6 +13,10 @@ interface LicensePageProps {
1213
}
1314

1415
export default async function LicensePage({ params: { domain } }: LicensePageProps) {
16+
if (env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT !== undefined) {
17+
notFound();
18+
}
19+
1520
const licenseKey = await getLicenseKey();
1621
const entitlements = await getEntitlements();
1722
const plan = await getPlan();

0 commit comments

Comments
 (0)