Prettier format pending files
This commit is contained in:
parent
518b59ce7e
commit
d3f8fad03e
1 changed files with 11 additions and 8 deletions
|
|
@ -698,21 +698,24 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
if (provider === "discord") {
|
if (provider === "discord") {
|
||||||
try {
|
try {
|
||||||
const apiBase =
|
const apiBase =
|
||||||
(import.meta as any)?.env?.VITE_API_BASE ||
|
(import.meta as any)?.env?.VITE_API_BASE || window.location.origin;
|
||||||
window.location.origin;
|
|
||||||
const u = new URL("/api/discord/oauth/start", apiBase);
|
const u = new URL("/api/discord/oauth/start", apiBase);
|
||||||
u.searchParams.set("state", encodeURIComponent(JSON.stringify({
|
u.searchParams.set(
|
||||||
action: "link",
|
"state",
|
||||||
redirectTo: `${window.location.origin}/dashboard?tab=connections`,
|
encodeURIComponent(
|
||||||
})));
|
JSON.stringify({
|
||||||
|
action: "link",
|
||||||
|
redirectTo: `${window.location.origin}/dashboard?tab=connections`,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
window.location.href = u.toString();
|
window.location.href = u.toString();
|
||||||
return;
|
return;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error("Discord link error:", error);
|
console.error("Discord link error:", error);
|
||||||
aethexToast.error({
|
aethexToast.error({
|
||||||
title: "Link failed",
|
title: "Link failed",
|
||||||
description:
|
description: error?.message || "Unable to link Discord right now.",
|
||||||
error?.message || "Unable to link Discord right now.",
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue