Remove entitlement check in microsoftAuth (#929)

redundant with the existing profile check
This commit is contained in:
extremeheat 2021-12-12 13:17:07 -05:00 committed by GitHub
parent d4bc14a583
commit 010d6b229c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ async function authenticate (client, options) {
}
const Authflow = new PrismarineAuth(options.username, options.profilesFolder, options, options.onMsaCode)
const { token, entitlements, profile } = await Authflow.getMinecraftJavaToken({ fetchEntitlements: true, fetchProfile: true }).catch(e => {
const { token, entitlements, profile } = await Authflow.getMinecraftJavaToken({ fetchProfile: true }).catch(e => {
if (options.password) console.warn('Sign in failed, try removing the password field\n')
if (e.toString().includes('Not Found')) console.warn(`Please verify that the account ${options.username} owns Minecraft\n`)
throw e
@ -23,7 +23,6 @@ async function authenticate (client, options) {
debug('[mc] entitlements', entitlements)
debug('[mc] profile', profile)
if (!entitlements.items?.length) throw Error(`Signed in account ${options.username} doesn't appear to own Minecraft`)
if (!profile || profile.error) throw Error(`Failed to obtain profile data for ${options.username}, does the account own minecraft?`)
options.haveCredentials = token !== null