From 0579027ff1d3f0b62bb0475d272c37d22bc2cae6 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 20 Jan 2021 19:37:27 -0300 Subject: [PATCH] try returning dummy profile when demo --- src/main/resources/web/auth.js | 2 +- src/main/resources/web/auth_ms.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/web/auth.js b/src/main/resources/web/auth.js index 320cd9d..0bc95cb 100644 --- a/src/main/resources/web/auth.js +++ b/src/main/resources/web/auth.js @@ -117,7 +117,7 @@ function refreshAccountList() { getMcAccounts().filter(isMojang).forEach(it => addMcAccountToList(it.id, it.name)); (myMSALObj.getAllAccounts() || []).forEach(msAccount => { let mcAcc = getMcAccounts().filter(isNotMojang).filter(it => it.msUser == msAccount.username)[0] || {}; - addMcAccountToList(mcAcc.id || "d3c47f6f-ae3a-45c1-ad7c-e2c762b03ae6", mcAcc.name || "[DEMO]", msAccount.username); + addMcAccountToList(mcAcc.id || "MHF_Question", mcAcc.name || "...", msAccount.username); }); } diff --git a/src/main/resources/web/auth_ms.js b/src/main/resources/web/auth_ms.js index d129878..159c772 100644 --- a/src/main/resources/web/auth_ms.js +++ b/src/main/resources/web/auth_ms.js @@ -61,7 +61,7 @@ function refreshTokenMs(username) { }).then(json => { return fetch(getCorsProxy() + "https://api.minecraftservices.com/minecraft/profile", { method: "get", headers: {"content-type": "application/json", "authorization": "Bearer " + json.access_token}}).then(profile => { - if (profile.status == 404) throw "no profile"; + if (profile.status == 404) return {id: "MHF_Exclamation", name: "[DEMO]"}; if (!isSuccess(profile.status)) throw "profile response not success"; return profile.json(); }).then(jsonProfile => {