fix: Update Discord login handling to use async/await for better error handling
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-11-15 00:06:13 +01:00
parent f503d59eeb
commit 64adfe7c3b
2 changed files with 11 additions and 7 deletions

View File

@@ -59,7 +59,8 @@
const accessToken = params.get("access_token"); const accessToken = params.get("access_token");
if (accessToken) { if (accessToken) {
let auth = $authV2Repo.loginDiscord(accessToken); (async () => {
let auth = await $authV2Repo.loginDiscord(accessToken);
if (!auth) { if (!auth) {
pw = ""; pw = "";
error = t("login.error"); error = t("login.error");
@@ -67,6 +68,7 @@
} }
navigate(l("/dashboard")); navigate(l("/dashboard"));
})();
} }
} }
}); });

View File

@@ -25,6 +25,8 @@ export class AuthV2Repo {
this.request("/data/me").then((value) => { this.request("/data/me").then((value) => {
if (value.ok) { if (value.ok) {
loggedIn.set(true); loggedIn.set(true);
} else {
loggedIn.set(false);
} }
}); });
} }