Update prismarine-auth usage (#153)

This commit is contained in:
extremeheat 2021-11-12 16:14:15 -05:00 committed by GitHub
commit 1b422ac4ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 10 deletions

View file

@ -16,12 +16,16 @@ async function authenticate (client, options) {
if (!options.profilesFolder) {
options.profilesFolder = path.join(minecraftFolderPath, 'nmp-cache')
}
if (!options.authTitle) {
if (options.authTitle === undefined) {
options.authTitle = Titles.MinecraftNintendoSwitch
options.deviceType = 'Nintendo'
}
try {
const Authflow = new PrismarineAuth(options.username, options.profilesFolder, options, options.onMsaCode)
const chains = await Authflow.getMinecraftBedrockToken(client.clientX509)
const chains = await Authflow.getMinecraftBedrockToken(client.clientX509).catch(e => {
if (options.password) console.warn('Sign in failed, try removing the password field')
throw e
})
debug('chains', chains)