try returning dummy profile when demo

This commit is contained in:
creeper123123321 2021-01-20 19:37:27 -03:00
parent 4c94a7047c
commit 0579027ff1
2 changed files with 2 additions and 2 deletions

View File

@ -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);
});
}

View File

@ -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 => {