mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-11-14 19:04:59 -05:00
Fix microsoft auth error condition handling (#925)
nullish operator can return undefined which causes `if` to not trigger in profile check
This commit is contained in:
parent
d0a504f5db
commit
9501694f23
1 changed files with 2 additions and 2 deletions
|
@ -23,8 +23,8 @@ async function authenticate (client, options) {
|
|||
debug('[mc] entitlements', entitlements)
|
||||
debug('[mc] profile', profile)
|
||||
|
||||
if (!entitlements?.items) throw Error(`Signed in account ${options.username} doesn't appear to own Minecraft`)
|
||||
if (profile?.error) throw Error(`Failed to obtain profile data for ${options.username}, does the account own minecraft?`)
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue