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.

useSession(), move api/og to app router

Steven Teyf4c40ba27614
diff --git a/apps/web/pages/api/og/stats.tsx b/apps/web/app/api/og/stats/route.tsx
similarity index 98%
rename from apps/web/pages/api/og/stats.tsx
rename to apps/web/app/api/og/stats/route.tsx
index fc49468cc5..1db2ee5850 100644
--- a/apps/web/pages/api/og/stats.tsx
+++ b/apps/web/app/api/og/stats/route.tsx
@@ -14,7 +14,7 @@ const satoshiBold = fetch(
new URL("@/styles/Satoshi-Bold.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
-export default async function handler(req: NextRequest) {
+export async function GET(req: NextRequest) {
const [satoshiBlackData, satoshiBoldData] = await Promise.all([
satoshiBLack,
satoshiBold,
diff --git a/apps/web/app/app.dub.co/(dashboard)/settings/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/settings/layout.tsx
index 926a4d5053..65654ae530 100644
--- a/apps/web/app/app.dub.co/(dashboard)/settings/layout.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/settings/layout.tsx
@@ -11,10 +11,10 @@ export default function PersonalSettingsLayout({
name: "General",
segment: null,
},
- {
- name: "API Keys",
- segment: "tokens",
- },
+ // {
+ // name: "API Keys",
+ // segment: "tokens",
+ // },
];
return <SettingsLayout tabs={tabs}>{children}</SettingsLayout>;
diff --git a/apps/web/ui/layout/project-select/client.tsx b/apps/web/ui/layout/project-select/client.tsx
index fa5679a14e..e780cdd4b6 100644
--- a/apps/web/ui/layout/project-select/client.tsx
+++ b/apps/web/ui/layout/project-select/client.tsx
@@ -1,6 +1,5 @@
"use client";
-import { Session } from "@/lib/auth";
import { PlanProps, ProjectWithDomainProps } from "@/lib/types";
import { ModalContext } from "@/ui/modals/provider";
import PlanBadge from "@/ui/projects/plan-badge";
@@ -14,11 +13,10 @@ import { useCallback, useContext, useMemo, useState } from "react";
export default function ProjectSelectClient({
projects,
- session,
}: {
projects: ProjectWithDomainProps[];
- session: Session;
}) {
+ const { data: session } = useSession();
const { slug, key } = useParams() as {
slug?: string;
key?: string;
diff --git a/apps/web/ui/layout/project-select/index.tsx b/apps/web/ui/layout/project-select/index.tsx
index eb578f27d3..30b57865f1 100644
--- a/apps/web/ui/layout/project-select/index.tsx
+++ b/apps/web/ui/layout/project-select/index.tsx
@@ -1,8 +1,7 @@
-import { getSession } from "@/lib/auth-app";
import { getProjects } from "@/lib/fetchers";
import ProjectSelectClient from "./client";
export default async function ProjectSelect() {
- const [session, projects] = await Promise.all([getSession(), getProjects()]);
- return <ProjectSelectClient session={session} projects={projects || []} />;
+ const projects = await getProjects();
+ return <ProjectSelectClient projects={projects || []} />;
}