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.

update signin page

Kiran Kcc74a58c28c7
diff --git a/apps/web/app/app.dub.co/(auth)/forgot-password/page.tsx b/apps/web/app/app.dub.co/(auth)/forgot-password/page.tsx
index 7bf903f162..1e47cf8b40 100644
--- a/apps/web/app/app.dub.co/(auth)/forgot-password/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/forgot-password/page.tsx
@@ -1,4 +1,4 @@
-import AuthLayout from "@/ui/layout/auth-layout";
+import AuthLayout from "@/ui/layout/old-auth-layout";
import { constructMetadata } from "@dub/utils";
import { ForgotPasswordForm } from "./form";
diff --git a/apps/web/app/app.dub.co/(auth)/login/form.tsx b/apps/web/app/app.dub.co/(auth)/login/form.tsx
index 0fe196013e..be45846b7f 100644
--- a/apps/web/app/app.dub.co/(auth)/login/form.tsx
+++ b/apps/web/app/app.dub.co/(auth)/login/form.tsx
@@ -240,50 +240,69 @@ export default function LoginForm() {
setShowSSOOption,
}}
>
- <AnimatedSizeContainer height>
- <div className="grid gap-3 p-1">
- {authMethod && (
- <div className="flex flex-col gap-2">
- {authMethodComponent}
-
- {!showEmailPasswordOnly && authMethod === lastUsedAuthMethod && (
- <div className="text-center text-xs">
- <span className="text-gray-500">
- You signed in with{" "}
- {lastUsedAuthMethod.charAt(0).toUpperCase() +
- lastUsedAuthMethod.slice(1)}{" "}
- last time
- </span>
+ <div className="w-full max-w-md overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-sm">
+ <div className="border-b border-gray-200 bg-white pb-6 pt-8 text-center">
+ <h3 className="text-lg font-semibold">Sign in to your Dub account</h3>
+ </div>
+ <div className="grid gap-3 bg-gray-50 px-4 py-8 sm:px-16">
+ <AnimatedSizeContainer height>
+ <div className="grid gap-3 p-1">
+ {authMethod && (
+ <div className="flex flex-col gap-2">
+ {authMethodComponent}
+
+ {!showEmailPasswordOnly &&
+ authMethod === lastUsedAuthMethod && (
+ <div className="text-center text-xs">
+ <span className="text-gray-500">
+ You signed in with{" "}
+ {lastUsedAuthMethod.charAt(0).toUpperCase() +
+ lastUsedAuthMethod.slice(1)}{" "}
+ last time
+ </span>
+ </div>
+ )}
+ <div className="my-2 flex flex-shrink items-center justify-center gap-2">
+ <div className="grow basis-0 border-b border-gray-300" />
+ <span className="text-xs font-normal uppercase leading-none text-gray-500">
+ or
+ </span>
+ <div className="grow basis-0 border-b border-gray-300" />
+ </div>
</div>
)}
- <div className="my-2 flex flex-shrink items-center justify-center gap-2">
- <div className="grow basis-0 border-b border-gray-300" />
- <span className="text-xs font-normal uppercase leading-none text-gray-500">
- or
- </span>
- <div className="grow basis-0 border-b border-gray-300" />
- </div>
- </div>
- )}
- {showEmailPasswordOnly ? (
- <div className="mt-2 text-center text-sm text-gray-500">
- <button
- type="button"
- onClick={() => setShowPasswordField(false)}
- className="font-semibold text-gray-500 transition-colors hover:text-black"
- >
- Continue with another method
- </button>
+
+ {showEmailPasswordOnly ? (
+ <div className="mt-2 text-center text-sm text-gray-500">
+ <button
+ type="button"
+ onClick={() => setShowPasswordField(false)}
+ className="font-semibold text-gray-500 transition-colors hover:text-black"
+ >
+ Continue with another method
+ </button>
+ </div>
+ ) : (
+ authProviders
+ .filter((provider) => provider.method !== authMethod)
+ .map((provider) => (
+ <div key={provider.method}>{provider.component}</div>
+ ))
+ )}
</div>
- ) : (
- authProviders
- .filter((provider) => provider.method !== authMethod)
- .map((provider) => (
- <div key={provider.method}>{provider.component}</div>
- ))
- )}
+ </AnimatedSizeContainer>
</div>
- </AnimatedSizeContainer>
+ </div>
+
+ <p className="mt-4 text-center text-sm text-gray-500">
+ Don't have an account?&nbsp;
+ <Link
+ href="register"
+ className="font-semibold text-gray-500 underline underline-offset-2 transition-colors hover:text-black"
+ >
+ Sign up
+ </Link>
+ </p>
</LoginFormContext.Provider>
);
}
diff --git a/apps/web/app/app.dub.co/(auth)/login/page.tsx b/apps/web/app/app.dub.co/(auth)/login/page.tsx
index 4a412eff2d..59cbab8dd8 100644
--- a/apps/web/app/app.dub.co/(auth)/login/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/login/page.tsx
@@ -1,4 +1,4 @@
-import AuthLayout from "@/ui/layout/auth-layout";
+import { AuthLayout } from "@/ui/layout/auth-layout";
import { constructMetadata } from "@dub/utils";
import LoginForm from "./form";
@@ -8,7 +8,7 @@ export const metadata = constructMetadata({
export default function LoginPage() {
return (
- <AuthLayout variant="login">
+ <AuthLayout>
<LoginForm />
</AuthLayout>
);
diff --git a/apps/web/app/app.dub.co/(auth)/register/page.tsx b/apps/web/app/app.dub.co/(auth)/register/page.tsx
index b690e5691d..688985f538 100644
--- a/apps/web/app/app.dub.co/(auth)/register/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/register/page.tsx
@@ -1,4 +1,4 @@
-import AuthLayout from "@/ui/layout/auth-layout";
+import AuthLayout from "@/ui/layout/old-auth-layout";
import { constructMetadata } from "@dub/utils";
import { RegisterForm } from "./form";
diff --git a/apps/web/ui/layout/auth-layout.tsx b/apps/web/ui/layout/auth-layout.tsx
index f23b2b5c88..1e8bc28f2a 100644
--- a/apps/web/ui/layout/auth-layout.tsx
+++ b/apps/web/ui/layout/auth-layout.tsx
@@ -1,5 +1,4 @@
import { BlurImage, ClientOnly, Wordmark } from "@dub/ui";
-import Link from "next/link";
import { Suspense } from "react";
const logos = [
@@ -17,48 +16,21 @@ const logos = [
"cal",
];
-export default function AuthLayout({
- variant,
- heading,
- children,
-}: {
- variant: "login" | "register";
- heading?: string;
+interface AuthLayoutProps {
children: React.ReactNode;
-}) {
+}
+
+export const AuthLayout = ({ children }: AuthLayoutProps) => {
return (
<div className="grid w-full grid-cols-1 md:grid-cols-5">
<div className="col-span-1 flex min-h-screen flex-col items-center justify-between border-r border-gray-200 bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur sm:col-span-3">
<div className="flex h-full w-full flex-col items-center justify-center">
- {/* Use ClientOnly because the login form relies on local storage for its initial render */}
- <ClientOnly className="relative flex w-full flex-col items-center justify-center">
+ <ClientOnly className="relative flex w-full flex-col items-center justify-center">
<Wordmark className="mb-8 h-12" />
- <div className="w-full max-w-md overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-sm">
- <div className="border-b border-gray-200 bg-white pb-6 pt-8 text-center">
- <h3 className="text-lg font-semibold">
- {heading ||
- (variant === "login"
- ? "Sign in to your Dub account"
- : "Get started with Dub")}
- </h3>
- </div>
- <div className="grid gap-3 bg-gray-50 px-4 py-8 sm:px-16">
- <Suspense>{children}</Suspense>
- </div>
- </div>
- <p className="mt-4 text-center text-sm text-gray-500">
- {variant === "login"
- ? "Don't have an account?"
- : "Already have an account?"}{" "}
- <Link
- href={`/${variant === "login" ? "register" : "login"}`}
- className="font-semibold text-gray-500 underline underline-offset-2 transition-colors hover:text-black"
- >
- {variant === "login" ? "Sign up" : "Sign in"}
- </Link>
- </p>
+ <Suspense>{children}</Suspense>
</ClientOnly>
</div>
+
<div className="grid gap-2 pb-8 pt-4">
<p className="text-xs text-gray-600">
© {new Date().getFullYear()} Dub Technologies, Inc.
@@ -81,6 +53,7 @@ export default function AuthLayout({
</div>
</div>
</div>
+
<div className="hidden h-full flex-col justify-center space-y-12 overflow-hidden md:col-span-2 md:flex">
<div className="ml-12 h-1/2 w-[112%] rounded-xl border border-gray-200 p-2 shadow-xl">
<BlurImage
@@ -110,4 +83,4 @@ export default function AuthLayout({
</div>
</div>
);
-}
+};
diff --git a/apps/web/ui/layout/old-auth-layout.tsx b/apps/web/ui/layout/old-auth-layout.tsx
new file mode 100644
index 0000000000..f23b2b5c88
--- /dev/null
+++ b/apps/web/ui/layout/old-auth-layout.tsx
@@ -0,0 +1,113 @@
+import { BlurImage, ClientOnly, Wordmark } from "@dub/ui";
+import Link from "next/link";
+import { Suspense } from "react";
+
+const logos = [
+ "vercel",
+ "perplexity",
+ "prisma",
+ "tinybird",
+ "hashnode",
+ "cal",
+ "vercel",
+ "perplexity",
+ "prisma",
+ "tinybird",
+ "hashnode",
+ "cal",
+];
+
+export default function AuthLayout({
+ variant,
+ heading,
+ children,
+}: {
+ variant: "login" | "register";
+ heading?: string;
+ children: React.ReactNode;
+}) {
+ return (
+ <div className="grid w-full grid-cols-1 md:grid-cols-5">
+ <div className="col-span-1 flex min-h-screen flex-col items-center justify-between border-r border-gray-200 bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur sm:col-span-3">
+ <div className="flex h-full w-full flex-col items-center justify-center">
+ {/* Use ClientOnly because the login form relies on local storage for its initial render */}
+ <ClientOnly className="relative flex w-full flex-col items-center justify-center">
+ <Wordmark className="mb-8 h-12" />
+ <div className="w-full max-w-md overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-sm">
+ <div className="border-b border-gray-200 bg-white pb-6 pt-8 text-center">
+ <h3 className="text-lg font-semibold">
+ {heading ||
+ (variant === "login"
+ ? "Sign in to your Dub account"
+ : "Get started with Dub")}
+ </h3>
+ </div>
+ <div className="grid gap-3 bg-gray-50 px-4 py-8 sm:px-16">
+ <Suspense>{children}</Suspense>
+ </div>
+ </div>
+ <p className="mt-4 text-center text-sm text-gray-500">
+ {variant === "login"
+ ? "Don't have an account?"
+ : "Already have an account?"}{" "}
+ <Link
+ href={`/${variant === "login" ? "register" : "login"}`}
+ className="font-semibold text-gray-500 underline underline-offset-2 transition-colors hover:text-black"
+ >
+ {variant === "login" ? "Sign up" : "Sign in"}
+ </Link>
+ </p>
+ </ClientOnly>
+ </div>
+ <div className="grid gap-2 pb-8 pt-4">
+ <p className="text-xs text-gray-600">
+ © {new Date().getFullYear()} Dub Technologies, Inc.
+ </p>
+ <div className="flex gap-3 text-center text-xs text-gray-500 underline underline-offset-2">
+ <a
+ href="https://dub.co/privacy"
+ target="_blank"
+ className="hover:text-gray-800"
+ >
+ Privacy Policy
+ </a>
+ <a
+ href="https://dub.co/terms"
+ target="_blank"
+ className="hover:text-gray-800"
+ >
+ Terms of Service
+ </a>
+ </div>
+ </div>
+ </div>
+ <div className="hidden h-full flex-col justify-center space-y-12 overflow-hidden md:col-span-2 md:flex">
+ <div className="ml-12 h-1/2 w-[112%] rounded-xl border border-gray-200 p-2 shadow-xl">
+ <BlurImage
+ alt="Dub.co Analytics"
+ src="https://assets.dub.co/compare/dub-analytics.png"
+ width={3236}
+ height={1618}
+ className="h-full rounded-lg border border-gray-200 object-cover"
+ />
+ </div>
+ <a
+ href="https://dub.co/customers"
+ target="_blank"
+ className="animate-infinite-scroll flex items-center space-x-4"
+ >
+ {logos.map((logo, idx) => (
+ <BlurImage
+ alt={`${logo} logo`}
+ key={idx}
+ src={`https://dub.co/_static/clients/${logo}.svg`}
+ width={520}
+ height={182}
+ className="h-12 grayscale transition-all hover:grayscale-0"
+ />
+ ))}
+ </a>
+ </div>
+ </div>
+ );
+}