Skip to content

Commit f345a96

Browse files
NicolappsConvex, Inc.
authored andcommitted
Fix bug where the referral signup flow would show the login button twice (#35934)
GitOrigin-RevId: e55fc6a581a25a8caf8d113ba3d1d12c12833dd3
1 parent 9271739 commit f345a96

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

npm-packages/dashboard/src/components/referral/RedeemReferralLanding.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("RedeemReferralLanding", () => {
1212
const link = screen.getByRole("link", { name: "Sign up with GitHub" });
1313
expect(link).toHaveAttribute(
1414
"href",
15-
`/api/auth/login?returnTo=/referral/${code}/apply`,
15+
`/api/auth/login?returnTo=%2Freferral%2F${code}%2Fapply`,
1616
);
1717
expect(link).toHaveAttribute("aria-disabled", "false");
1818

npm-packages/dashboard/src/components/referral/RedeemReferralLanding.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { GitHubLogoIcon } from "@radix-ui/react-icons";
2-
import { Button } from "dashboard-common/elements/Button";
32
import { Sheet } from "dashboard-common/elements/Sheet";
43
import { Spinner } from "dashboard-common/elements/Spinner";
54
import { cn } from "dashboard-common/lib/cn";
@@ -57,14 +56,15 @@ function LogInButton({ code }: { code: string }) {
5756
const [clicked, setClicked] = useState(false);
5857

5958
return (
60-
<Button
61-
variant="unstyled"
59+
// Using <a> instead of <Button>/<Link> to fix an issue where Auth0 would refuse to redirect
60+
// to GitHub when following the link.
61+
<a
6262
className={cn(
6363
"group z-10 inline-flex rounded-full bg-gradient-to-br from-[#8d2676_33%] via-[#ee342f] via-90% to-[#f3b01c] to-100% p-0.5 font-marketing shadow-[0_2px_14px_rgba(111,0,255,0.25)] transition-shadow my-2",
6464
!clicked && "hover:shadow-[rgba(111,0,255,0.5)]",
6565
clicked && "opacity-80 cursor-progress",
6666
)}
67-
href={`/api/auth/login?returnTo=/referral/${code}/apply`}
67+
href={`/api/auth/login?returnTo=${encodeURIComponent(`/referral/${code}/apply`)}`}
6868
onClick={() => setClicked(true)}
6969
aria-disabled={clicked}
7070
>
@@ -76,6 +76,6 @@ function LogInButton({ code }: { code: string }) {
7676
Sign up with GitHub
7777
{clicked && <Spinner className="size-4 text-white" />}
7878
</span>
79-
</Button>
79+
</a>
8080
);
8181
}

0 commit comments

Comments
 (0)