diff --git a/src/client/microsoftAuth.js b/src/client/microsoftAuth.js index 8aea9890..99e947be 100644 --- a/src/client/microsoftAuth.js +++ b/src/client/microsoftAuth.js @@ -19,7 +19,7 @@ async function authenticate (client, options) { validateOptions(options) if (!client.authflow) client.authflow = new PrismarineAuth(options.username, options.profilesFolder, options, options.onMsaCode) - const { token, entitlements, profile, certificates } = await client.authflow.getMinecraftJavaToken({ fetchProfile: true, fetchCertificates: !options.disableChatSigning }).catch(e => { + const { token, entitlements, profile, certificates } = await client.authflow.getMinecraftJavaToken({ fetchProfile: true, fetchCertificates: !options.disableChatSigning, msaToken: options.msaToken }).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 diff --git a/src/index.d.ts b/src/index.d.ts index 42308525..8d6a0e9b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -154,6 +154,7 @@ declare module 'minecraft-protocol' { disableChatSigning?: boolean /** Pass custom client implementation if needed. */ Client?: Client + msaToken?: string // directly pass MSA bearer token } export class Server extends EventEmitter {