From d83aadc4c38ce7d264ce41bc2e916ce3de01a18e Mon Sep 17 00:00:00 2001 From: Pierce Date: Tue, 27 Aug 2019 17:30:44 -0400 Subject: [PATCH] Version bump, warnings, code refactor! --- README.md | 2 ++ components/handler.js | 4 +--- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 706d092..c8c073b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ const launcher = new Client(); let opts = { clientPackage: null, + // For production launchers, I recommend not passing the getAuth function through the authorization field and instead + // handling authentication outside before you initialize MCLC so you can handle auth based errors and validation! authorization: Authenticator.getAuth("username", "password"), root: "./minecraft", os: "windows", diff --git a/components/handler.js b/components/handler.js index dec887b..3977d29 100644 --- a/components/handler.js +++ b/components/handler.js @@ -417,9 +417,7 @@ class Handler { const minArgs = this.options.overrides.minArgs || 5; if(args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game); - if({}.toString.call(this.options.authorization) === "[object Promise]") { - this.options.authorization = await this.options.authorization; - } + this.options.authorization = await Promise.resolve(this.options.authorization); const fields = { '${auth_access_token}': this.options.authorization.access_token, diff --git a/package.json b/package.json index d5afdfe..4cc4657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.10.0", + "version": "3.10.1", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {