Skip to content

Commit

Permalink
Check for Microsoft auth
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienHH committed Jun 8, 2022
1 parent 1fa4ac7 commit 50bc31e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/client_realms/client_realms.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const client = mc.createClient({
pickRealm: (realms) => realms.find(e => e.name === 'Realm Name') // Connect the client to a Realm using a function that returns a Realm
},
username: username,
auth: 'microsoft' // This option must be present and set to 'microsoft' to use Microsoft Account Authentication. Failure to do so will result in yggdrasil throwing invalid account information.
auth: 'microsoft' // This option must be present and set to 'microsoft' to join a Realm.
})

client.on('connect', function () {
Expand Down
1 change: 1 addition & 0 deletions src/createClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function createClient (options) {
assert.ok(options, 'options is required')
assert.ok(options.username, 'username is required')
if (!options.version && !options.realms) { options.version = false }
if (options.realms && options.auth !== 'microsoft') throw new Error('Currently Realms can only be joined with auth: "microsoft"')

// TODO: avoid setting default version if autoVersion is enabled
const optVersion = options.version || require('./version').defaultVersion
Expand Down

0 comments on commit 50bc31e

Please sign in to comment.