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.

Fix Framer custom login

Steven Teyfcb4b1673b86
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/layout.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/layout.tsx
deleted file mode 100644
index 08b3e7dd2a..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/layout.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Grid, Wordmark } from "@dub/ui";
-
-export default function CustomPartnerAuthLayout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return (
- <div className="flex min-h-screen flex-col">
- <div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
- <Grid className="text-neutral-200" />
- <div className="absolute inset-0 -translate-y-1/2 -scale-x-100 bg-[conic-gradient(from_-32deg,#f00_0deg,#EAB308_99deg,#5CFF80_162deg,#00FFF9_216deg,#3A8BFD_288deg,#855AFC_360deg)] opacity-25 blur-[200px]" />
- </div>
- <div className="relative z-10 flex grow flex-col items-center justify-center px-3 text-center md:px-8">
- {children}
- </div>
- <div className="flex flex-col justify-end">
- <div className="relative flex w-full flex-col items-center justify-center gap-2 py-10 pb-6">
- <a
- href="https://dub.co/partners"
- target="_blank"
- className="mt-4 flex items-center justify-center gap-1.5 text-neutral-500 transition-colors duration-75 hover:text-neutral-700"
- >
- <p className="text-xs font-medium">Powered by</p>
- <Wordmark className="h-3.5 text-neutral-900" />
- </a>
-
- <div className="flex gap-3 text-center text-xs text-neutral-500 underline underline-offset-2">
- <a
- href="https://dub.co/legal/privacy"
- target="_blank"
- className="hover:text-neutral-800"
- >
- Privacy Policy
- </a>
- <a
- href="https://dub.co/legal/terms"
- target="_blank"
- className="hover:text-neutral-800"
- >
- Terms of Service
- </a>
- </div>
- </div>
- </div>
- </div>
- );
-}
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/page.tsx
deleted file mode 100644
index 4d155bd6d6..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(custom)/framer/login/page.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { FramerButton } from "@/ui/auth/login/framer-button";
-import { APP_DOMAIN, constructMetadata } from "@dub/utils";
-import Link from "next/link";
-
-export const metadata = constructMetadata({
- title: `Sign in to Framer Partners`,
- canonicalUrl: `${APP_DOMAIN}/login`,
-});
-
-export default function CustomPartnerLoginPage() {
- return (
- <div className="mx-auto my-10 flex w-full max-w-sm flex-col gap-8">
- <div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
- <img
- src="https://assets.dub.co/testimonials/companies/framer.svg"
- alt="Framer Logo"
- className="h-8"
- />
- </div>
- <div className="animate-slide-up-fade flex flex-col items-center justify-center gap-2 [--offset:10px] [animation-delay:0.15s] [animation-duration:1.3s] [animation-fill-mode:both]">
- <h1 className="text-lg font-medium text-neutral-800">
- Sign in to Framer Partners
- </h1>
- <p className="text-center text-sm text-neutral-700">
- Not a Framer Partner?&nbsp;
- <Link
- href="https://www.framer.com/creators"
- target="_blank"
- className="font-normal underline underline-offset-2 transition-colors hover:text-black"
- >
- Apply today
- </Link>
- </p>
- </div>
-
- <div className="animate-slide-up-fade [--offset:10px] [animation-delay:0.3s] [animation-duration:1.3s] [animation-fill-mode:both]">
- <FramerButton />
- </div>
- </div>
- );
-}
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/login/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/login/page.tsx
deleted file mode 100644
index 37a0cb9ccf..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/login/page.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { getProgram } from "@/lib/fetchers/get-program";
-import { AuthAlternativeBanner } from "@/ui/auth/auth-alternative-banner";
-import LoginForm from "@/ui/auth/login/login-form";
-import { AuthLayout } from "@/ui/layout/auth-layout";
-import Link from "next/link";
-import { notFound } from "next/navigation";
-import { PartnerBanner } from "../partner-banner";
-
-export default async function LoginPage({
- params: { programSlug },
-}: {
- params: { programSlug?: string };
-}) {
- const program = programSlug ? await getProgram({ slug: programSlug }) : null;
-
- if (programSlug && !program) {
- notFound();
- }
-
- return (
- <AuthLayout showTerms>
- <div className="w-full max-w-sm">
- {program && <PartnerBanner program={program} />}
- <h1 className="text-center text-xl font-semibold">
- Log in to your Dub Partner account
- </h1>
- <div className="mt-8">
- <LoginForm
- methods={["email", "password", "google"]}
- next={`/${programSlug ? `/programs/${programSlug}` : ""}`}
- />
- </div>
- <p className="mt-6 text-center text-sm font-medium text-neutral-500">
- Don't have a partner account?&nbsp;
- <Link
- href={`${programSlug ? `/${programSlug}` : ""}/register`}
- className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"
- >
- Sign up
- </Link>
- </p>
-
- <div className="mt-12 w-full">
- <AuthAlternativeBanner
- text="Looking for your Dub workspace account?"
- cta="Log in at app.dub.co"
- href="https://app.dub.co/login"
- />
- </div>
- </div>
- </AuthLayout>
- );
-}
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/login/page.tsx
similarity index 65%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/login/page.tsx
index 1d4bfd07ab..4894b09959 100644
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/login/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/login/page.tsx
@@ -1,6 +1,6 @@
export {
generateMetadata,
generateStaticParams,
-} from "../../../../(apply)/[programSlug]/layout";
+} from "../../../(apply)/[programSlug]/layout";
export { default } from "../../login/page";
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/register/page.tsx
similarity index 66%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/register/page.tsx
index 4de1c0abcb..4aac7dc609 100644
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/[programSlug]/register/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(auth)/[programSlug]/register/page.tsx
@@ -1,6 +1,6 @@
export {
generateMetadata,
generateStaticParams,
-} from "../../../../(apply)/[programSlug]/layout";
+} from "../../../(apply)/[programSlug]/layout";
export { default } from "../../register/page";
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/auth/reset-password/[token]/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/auth/reset-password/[token]/page.tsx
similarity index 100%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/auth/reset-password/[token]/page.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/auth/reset-password/[token]/page.tsx
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/forgot-password/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/forgot-password/page.tsx
similarity index 100%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/forgot-password/page.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/forgot-password/page.tsx
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/layout.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/layout.tsx
similarity index 100%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/layout.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/layout.tsx
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/login/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/login/page.tsx
new file mode 100644
index 0000000000..e604d9943c
--- /dev/null
+++ b/apps/web/app/(ee)/partners.dub.co/(auth)/login/page.tsx
@@ -0,0 +1,85 @@
+import { getProgram } from "@/lib/fetchers/get-program";
+import { AuthAlternativeBanner } from "@/ui/auth/auth-alternative-banner";
+import { FramerButton } from "@/ui/auth/login/framer-button";
+import LoginForm from "@/ui/auth/login/login-form";
+import { AuthLayout } from "@/ui/layout/auth-layout";
+import Link from "next/link";
+import { notFound } from "next/navigation";
+import { PartnerBanner } from "../partner-banner";
+
+export default async function LoginPage({
+ params: { programSlug },
+}: {
+ params: { programSlug?: string };
+}) {
+ const program = programSlug ? await getProgram({ slug: programSlug }) : null;
+
+ if (programSlug && !program) {
+ notFound();
+ }
+
+ return (
+ <AuthLayout showTerms>
+ {programSlug === "framer" ? (
+ <div className="mx-auto my-10 flex w-full max-w-sm flex-col gap-8">
+ <div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <img
+ src="https://assets.dub.co/testimonials/companies/framer.svg"
+ alt="Framer Logo"
+ className="h-8"
+ />
+ </div>
+ <div className="animate-slide-up-fade flex flex-col items-center justify-center gap-2 [--offset:10px] [animation-delay:0.15s] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <h1 className="text-lg font-medium text-neutral-800">
+ Sign in to Framer Partners
+ </h1>
+ <p className="text-center text-sm text-neutral-700">
+ Not a Framer Partner?&nbsp;
+ <Link
+ href="https://www.framer.com/creators"
+ target="_blank"
+ className="font-normal underline underline-offset-2 transition-colors hover:text-black"
+ >
+ Apply today
+ </Link>
+ </p>
+ </div>
+
+ <div className="animate-slide-up-fade [--offset:10px] [animation-delay:0.3s] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <FramerButton />
+ </div>
+ </div>
+ ) : (
+ <div className="w-full max-w-sm">
+ {program && <PartnerBanner program={program} />}
+ <h1 className="text-center text-xl font-semibold">
+ Log in to your Dub Partner account
+ </h1>
+ <div className="mt-8">
+ <LoginForm
+ methods={["email", "password", "google"]}
+ next={`/${programSlug ? `/programs/${programSlug}` : ""}`}
+ />
+ </div>
+ <p className="mt-6 text-center text-sm font-medium text-neutral-500">
+ Don't have a partner account?&nbsp;
+ <Link
+ href={`${programSlug ? `/${programSlug}` : ""}/register`}
+ className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"
+ >
+ Sign up
+ </Link>
+ </p>
+
+ <div className="mt-12 w-full">
+ <AuthAlternativeBanner
+ text="Looking for your Dub workspace account?"
+ cta="Log in at app.dub.co"
+ href="https://app.dub.co/login"
+ />
+ </div>
+ </div>
+ )}
+ </AuthLayout>
+ );
+}
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/partner-banner.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/partner-banner.tsx
similarity index 100%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/partner-banner.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/partner-banner.tsx
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/register/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/register/page-client.tsx
similarity index 100%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/register/page-client.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/register/page-client.tsx
diff --git a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/register/page.tsx b/apps/web/app/(ee)/partners.dub.co/(auth)/register/page.tsx
similarity index 91%
rename from apps/web/app/(ee)/partners.dub.co/(auth)/(default)/register/page.tsx
rename to apps/web/app/(ee)/partners.dub.co/(auth)/register/page.tsx
index f2a73ed442..58ea4289d9 100644
--- a/apps/web/app/(ee)/partners.dub.co/(auth)/(default)/register/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(auth)/register/page.tsx
@@ -1,7 +1,7 @@
import { getProgram } from "@/lib/fetchers/get-program";
import { prisma } from "@dub/prisma";
import { cookies } from "next/headers";
-import { notFound } from "next/navigation";
+import { notFound, redirect } from "next/navigation";
import RegisterPageClient from "./page-client";
export default async function RegisterPage({
@@ -9,6 +9,10 @@ export default async function RegisterPage({
}: {
params: { programSlug?: string };
}) {
+ if (programSlug === "framer") {
+ redirect("/framer/login");
+ }
+
const program = programSlug
? (await getProgram({ slug: programSlug })) ?? undefined
: undefined;