Skip to content

Open source CapCut alternative.

TypeScript

fix(site): full-page nav for landing auth links so sign-in renders from the home page

David Leb2befbcafb6a
diff --git a/site/src/app/_components/landing/LandingPrimitives.tsx b/site/src/app/_components/landing/LandingPrimitives.tsx
index f48a792b..dbc6d177 100644
--- a/site/src/app/_components/landing/LandingPrimitives.tsx
+++ b/site/src/app/_components/landing/LandingPrimitives.tsx
@@ -9,6 +9,15 @@ function isInternalHref(href: string) {
return href.startsWith("/") && !href.startsWith("//");
}
+// The auth pages (/sign-in, /sign-up) are proxy passthrough routes that live
+// outside the "/" → "/cut" rewrite the proxy uses to serve the landing on
+// donkeycut.com. App Router soft-navigation can't cross that rewrite boundary —
+// a next/link click flips the URL but never renders the auth screen — so links
+// to these routes must be plain anchors that trigger a full-page navigation.
+function isAuthPassthroughHref(href: string) {
+ return href.startsWith("/sign-in") || href.startsWith("/sign-up");
+}
+
type ButtonVariant = "primary" | "dark" | "secondary";
type ButtonSize = "sm" | "md" | "lg";
@@ -147,7 +156,7 @@ export function PillButton({
};
if (href && !disabled && !onClick) {
- if (isInternalHref(href)) {
+ if (isInternalHref(href) && !isAuthPassthroughHref(href)) {
return (
<Link aria-label={ariaLabel} href={href} style={sharedStyle}>
{children}
diff --git a/site/src/app/_components/landing/TopNav.tsx b/site/src/app/_components/landing/TopNav.tsx
index e0e6789a..688bd235 100644
--- a/site/src/app/_components/landing/TopNav.tsx
+++ b/site/src/app/_components/landing/TopNav.tsx
@@ -85,12 +85,15 @@ export function TopNav({
</PillButton>
) : signedOutAuth ? (
<>
- <Link
+ {/* Auth pages sit outside the "/" → "/cut" landing rewrite, which
+ App Router soft-navigation can't cross; a plain anchor does the
+ full-page navigation the sign-in route needs. */}
+ <a
href={signedOutAuth.logInHref}
className="whitespace-nowrap text-sm font-semibold text-ink no-underline"
>
Log in
- </Link>
+ </a>
<PillButton
href={signedOutAuth.signUpHref}
variant="primary"