This commit is contained in:
creeper123123321 2021-09-28 20:30:39 -03:00
parent 45fc6e4f40
commit f66f6ea3dd
4 changed files with 17 additions and 18 deletions

View File

@ -1,11 +0,0 @@
name: Gradle dependencyUpdates
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 16
- run: ./gradlew dependencyUpdates

View File

@ -135,10 +135,6 @@ Fabric client:
### Accounts
#### My Microsoft account <18 years old is not able to log in, it's showing XSTS error:
- Add your account to a family (see https://wiki.vg/Microsoft_Authentication_Scheme#Authenticate_with_XSTS)
#### Why to use an online webpage for online mode?:
- It's easier to maintain in that way, because providing login via chat requires encoding and decoding more packets,

View File

@ -15,7 +15,6 @@ plugins {
kotlin("jvm") version "1.5.31"
id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.0.0"
id("com.github.ben-manes.versions") version "0.39.0"
id("com.palantir.git-version") version "0.12.3"
id("org.gradlewebtools.minify") version "1.3.0" apply false
}

View File

@ -512,6 +512,21 @@ class MicrosoftAccount extends McAccount {
}),
headers: {"content-type": "application/json"}
})
.then(data => {
if (data.status !== 401) return data;
return data.json().then(errorData => {
let error = errorData.XErr;
switch (error) {
case 2148916233:
throw "Xbox account not found";
case 2148916235:
throw "Xbox Live not available in this country";
case 2148916238:
throw "Account is underage, add it to a family";
}
throw "xsts error code " + error;
});
})
.then(checkFetchSuccess("xsts response not success"))
.then(r => r.json()))
.then(json => fetch(getCorsProxy() + "https://api.minecraftservices.com/authentication/login_with_xbox", {
@ -526,8 +541,8 @@ class MicrosoftAccount extends McAccount {
headers: {"content-type": "application/json", "authorization": "Bearer " + json.access_token}
})
.then(profile => {
if (profile.status === 404) return {id: "MHF_Exclamation", name: "[DEMO]", access_token: ""};
if (!profile.ok) throw "profile response not success";
if (profile.status === 404) throw "Minecraft profile not found";
if (!profile.ok) throw "profile response not success " + profile.status;
return profile.json();
})
.then(jsonProfile => {