uses microsoft auth by default

This commit is contained in:
Romain Beaumont 2022-02-06 17:20:54 +00:00
parent 4691abd036
commit 5a653f68fe
3 changed files with 3 additions and 3 deletions

View file

@ -81,7 +81,7 @@ Returns a `Client` instance and perform login.
`options` is an object containing the properties :
* username
* port : default to 25565
* auth : the type of account to use, either `microsoft` or `mojang`. default to 'mojang'
* auth : the type of account to use, either `microsoft` or `mojang`. default to 'microsoft'
* password : can be omitted
* (microsoft account) leave this blank to use device code auth. If you provide
a password, we try to do username and password auth, but this does not always work.

View file

@ -78,7 +78,7 @@ var client = mc.createClient({
port: 25565, // optional
username: "email@example.com",
password: "12345678",
auth: 'mojang' // optional; by default uses mojang, if using a microsoft account, set to 'microsoft'
auth: 'microsoft' // optional; by default uses microsoft
});
client.on('chat', function(packet) {
// Listen for chat messages and echo them back.

View file

@ -82,7 +82,7 @@ module.exports = async function (client, options) {
remoteId: oldProfileObj?.remoteId ?? '',
username: options.username,
localId: profile,
type: (options.auth?.toLowerCase() === 'microsoft' ? 'Xbox' : 'Mojang'),
type: (options.auth?.toLowerCase() === 'mojang' ? 'Mojang' : 'Xbox'),
persistent: true
}
auths.accounts[profile] = newProfileObj