Add Discord OAuth button to Login page
cgen-df002fcc61134da697f69f704951a34f
This commit is contained in:
parent
68852cccf0
commit
ca4d5a2a8e
1 changed files with 19 additions and 0 deletions
|
|
@ -399,6 +399,25 @@ export default function Login() {
|
|||
<Sparkles className="h-4 w-4 mr-2" />
|
||||
Continue with Roblox
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full hover-lift interactive-scale"
|
||||
onClick={() => {
|
||||
const apiBase =
|
||||
(import.meta as any)?.env?.VITE_API_BASE ||
|
||||
window.location.origin;
|
||||
const u = new URL("/api/discord/oauth/start", apiBase);
|
||||
const next = new URLSearchParams(
|
||||
window.location.search,
|
||||
).get("next");
|
||||
if (next && next.startsWith("/"))
|
||||
u.searchParams.set("state", next);
|
||||
window.location.href = u.toString();
|
||||
}}
|
||||
>
|
||||
<DiscordIcon />
|
||||
<span className="ml-2">Continue with Discord</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
|
|
|
|||
Loading…
Reference in a new issue