Add Discord to Login.tsx OAuth options
cgen-189215eeef9d4522908d3e7af60ddd1b
This commit is contained in:
parent
2a885a7ec1
commit
34bb97f6c6
1 changed files with 19 additions and 0 deletions
|
|
@ -407,6 +407,25 @@ export default function Login() {
|
||||||
<Mail className="h-4 w-4" />
|
<Mail className="h-4 w-4" />
|
||||||
<span className="hidden sm:inline ml-1">Google</span>
|
<span className="hidden sm:inline ml-1">Google</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
className="w-full hover-lift interactive-scale border-border/50 hover:border-purple-500/50 hover:bg-purple-500/10 transition-all duration-200"
|
||||||
|
onClick={() => {
|
||||||
|
const u = new URL(
|
||||||
|
"/api/discord/oauth/start",
|
||||||
|
API_BASE,
|
||||||
|
);
|
||||||
|
const next = new URLSearchParams(
|
||||||
|
window.location.search,
|
||||||
|
).get("next");
|
||||||
|
if (next && next.startsWith("/"))
|
||||||
|
u.searchParams.set("state", JSON.stringify({ redirectTo: next }));
|
||||||
|
window.location.href = u.toString();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DiscordIcon />
|
||||||
|
<span className="hidden sm:inline ml-1">Discord</span>
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue