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 header.tsx

Kiran K7ba7e7b496a2
diff --git a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
index e748392bf2..2781b01997 100644
--- a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
+++ b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
@@ -5,7 +5,7 @@ import { cn } from "@dub/utils";
import { Program } from "@prisma/client";
import { useSession } from "next-auth/react";
import Link from "next/link";
-import { useRouter } from "next/navigation";
+import { usePathname, useRouter } from "next/navigation";
export function Header({
program,
@@ -19,6 +19,7 @@ export function Header({
showApply?: boolean;
}) {
const router = useRouter();
+ const pathname = usePathname();
const { data: session, status } = useSession();
const scrolled = useScroll(0);
@@ -55,7 +56,7 @@ export function Header({
variant="secondary"
text="Log in"
className="animate-fade-in h-8 w-fit text-neutral-600"
- onClick={() => router.push(`/login?next=/apply/${slug}`)}
+ onClick={() => router.push(`/login?next=${pathname}`)}
/>
)}
{showApply && (