Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

put oauth apps behind a feature flag

Kiran K1e95d774b06e
diff --git a/apps/web/app/api/oauth-apps/[clientId]/route.ts b/apps/web/app/api/oauth-apps/[clientId]/route.ts
index f561d694b7..4eeb6c9094 100644
--- a/apps/web/app/api/oauth-apps/[clientId]/route.ts
+++ b/apps/web/app/api/oauth-apps/[clientId]/route.ts
@@ -26,6 +26,7 @@ export const GET = withWorkspace(
},
{
requiredPermissions: ["oauth_apps.read"],
+ featureFlag: "integrations",
},
);
@@ -54,6 +55,7 @@ export const PATCH = withWorkspace(
},
{
requiredPermissions: ["oauth_apps.write"],
+ featureFlag: "integrations",
},
);
@@ -84,5 +86,6 @@ export const DELETE = withWorkspace(
},
{
requiredPermissions: ["oauth_apps.write"],
+ featureFlag: "integrations",
},
);
diff --git a/apps/web/app/api/oauth-apps/route.ts b/apps/web/app/api/oauth-apps/route.ts
index 93e36ad0b5..6909f19949 100644
--- a/apps/web/app/api/oauth-apps/route.ts
+++ b/apps/web/app/api/oauth-apps/route.ts
@@ -7,6 +7,23 @@ import { createOAuthAppSchema, oAuthAppSchema } from "@/lib/zod/schemas/oauth";
import { NextResponse } from "next/server";
import { z } from "zod";
+// GET /api/oauth-apps - get all OAuth apps for a specific workspace
+export const GET = withWorkspace(
+ async ({ workspace }) => {
+ const apps = await prisma.oAuthApp.findMany({
+ where: {
+ projectId: workspace.id,
+ },
+ });
+
+ return NextResponse.json(z.array(oAuthAppSchema).parse(apps));
+ },
+ {
+ requiredPermissions: ["oauth_apps.read"],
+ featureFlag: "integrations",
+ },
+);
+
// POST /api/oauth-apps - create a new OAuth app
export const POST = withWorkspace(
async ({ req, workspace, session }) => {
@@ -47,21 +64,6 @@ export const POST = withWorkspace(
},
{
requiredPermissions: ["oauth_apps.write"],
- },
-);
-
-// GET /api/oauth-apps - get all OAuth apps for a specific workspace
-export const GET = withWorkspace(
- async ({ workspace }) => {
- const apps = await prisma.oAuthApp.findMany({
- where: {
- projectId: workspace.id,
- },
- });
-
- return NextResponse.json(z.array(oAuthAppSchema).parse(apps));
- },
- {
- requiredPermissions: ["oauth_apps.read"],
+ featureFlag: "integrations",
},
);
diff --git a/apps/web/ui/analytics/main.tsx b/apps/web/ui/analytics/main.tsx
index 0fc4b5ea7e..3c7f2174b3 100644
--- a/apps/web/ui/analytics/main.tsx
+++ b/apps/web/ui/analytics/main.tsx
@@ -3,7 +3,6 @@ import { CountingNumbers, NumberTooltip, useRouterStuff } from "@dub/ui";
import { cn } from "@dub/utils";
import { ChevronRight, Lock } from "lucide-react";
import Link from "next/link";
-import { useSearchParams } from "next/navigation";
import { useContext, useMemo } from "react";
import AnalyticsAreaChart from "./analytics-area-chart";
import { AnalyticsContext } from "./analytics-provider";
@@ -19,12 +18,8 @@ export default function Main() {
const { flags } = useWorkspace();
const { totalEvents, requiresUpgrade, demoPage, selectedTab } =
useContext(AnalyticsContext);
- const searchParams = useSearchParams();
const { queryParams } = useRouterStuff();
- // Root domain related
- const root = searchParams.get("root");
-
const tabs = useMemo(
() =>
[