The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Pass program slug to auth pages
Tim Wilson8fe531870163
diff --git a/apps/web/app/partners.dub.co/(apply)/[programSlug]/apply/success/cta-buttons.tsx b/apps/web/app/partners.dub.co/(apply)/[programSlug]/apply/success/cta-buttons.tsxindex 44b6ddb057..f62d5e06d1 100644--- a/apps/web/app/partners.dub.co/(apply)/[programSlug]/apply/success/cta-buttons.tsx+++ b/apps/web/app/partners.dub.co/(apply)/[programSlug]/apply/success/cta-buttons.tsx@@ -3,15 +3,17 @@import { Button } from "@dub/ui";import { useSession } from "next-auth/react";import Link from "next/link";-import { useRouter } from "next/navigation";+import { useParams } from "next/navigation";export function CTAButtons() {- const router = useRouter();- const { data: session, status } = useSession();+ const { programSlug } = useParams();+ const { status } = useSession();++ const slugPrefix = programSlug ? `/${programSlug}` : "";return (<>- <Link href={status === "authenticated" ? "/" : "/register"}>+ <Link href={status === "authenticated" ? "/" : `${slugPrefix}/register`}><Buttontype="button"text={@@ -23,7 +25,7 @@ export function CTAButtons() {/></Link>{status === "unauthenticated" && (- <Link href="/login">+ <Link href={`${slugPrefix}/login`}><Buttontype="button"variant="secondary"diff --git a/apps/web/app/partners.dub.co/(auth)/(custom)/[programSlug]/login/layout.tsx b/apps/web/app/partners.dub.co/(auth)/(custom)/framer/login/layout.tsxsimilarity index 100%rename from apps/web/app/partners.dub.co/(auth)/(custom)/[programSlug]/login/layout.tsxrename to apps/web/app/partners.dub.co/(auth)/(custom)/framer/login/layout.tsxdiff --git a/apps/web/app/partners.dub.co/(auth)/(custom)/[programSlug]/login/page.tsx b/apps/web/app/partners.dub.co/(auth)/(custom)/framer/login/page.tsxsimilarity index 100%rename from apps/web/app/partners.dub.co/(auth)/(custom)/[programSlug]/login/page.tsxrename to apps/web/app/partners.dub.co/(auth)/(custom)/framer/login/page.tsxdiff --git a/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsx b/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsxnew file mode 100644index 0000000000..fdc3fef84c--- /dev/null+++ b/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsx@@ -0,0 +1 @@+export { default } from "app/partners.dub.co/(auth)/(default)/login/page";diff --git a/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsx b/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsxnew file mode 100644index 0000000000..d8fc2c727c--- /dev/null+++ b/apps/web/app/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsx@@ -0,0 +1 @@+export { default } from "app/partners.dub.co/(auth)/(default)/register/page";