fixed promise chaining

This commit is contained in:
creeper123123321 2021-01-20 19:26:43 -03:00
parent af09a6a3ac
commit 4c94a7047c

View File

@ -59,7 +59,7 @@ function refreshTokenMs(username) {
if (!isSuccess(mcResponse.status)) throw "mc response not success";
return mcResponse.json();
}).then(json => {
fetch(getCorsProxy() + "https://api.minecraftservices.com/minecraft/profile", {
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 (!isSuccess(profile.status)) throw "profile response not success";