Minor fix to mojang api wrapper, removing default option on client token configuration, updating logo to scaled version.

This commit is contained in:
Daniel Scalzi 2018-01-18 23:41:03 -05:00
parent 6d6d876aa5
commit 1d10b0209a
4 changed files with 7 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -39,7 +39,7 @@ const DEFAULT_CONFIG = {
} }
}, },
clientToken: uuidV4(), clientToken: uuidV4().replace(/-/g, ''),
selectedServer: null, // Resolved selectedServer: null, // Resolved
selectedAccount: null, selectedAccount: null,
authenticationDatabase: {} authenticationDatabase: {}
@ -82,12 +82,12 @@ exports.load = function(){
/** /**
* Retrieve the launcher's Client Token. * Retrieve the launcher's Client Token.
* There is no default client token.
* *
* @param {Boolean} def - optional. If true, the default value will be returned.
* @returns {String} - the launcher's Client Token. * @returns {String} - the launcher's Client Token.
*/ */
exports.getClientToken = function(def = false){ exports.getClientToken = function(){
return !def ? config.clientToken : DEFAULT_CONFIG.clientToken return config.clientToken
} }
/** /**

View File

@ -148,9 +148,10 @@ exports.validate = function(accessToken, clientToken){
} }
}, },
function(error, response, body){ function(error, response, body){
if(error && error.message === 'Invalid token'){ if(response.statusCode === 403){
fulfill(false) fulfill(false)
} else { } else {
// 204 if valid
fulfill(true) fulfill(true)
} }
}) })
@ -212,7 +213,7 @@ exports.refresh = function(accessToken, clientToken, requestUser = true){
if(response.statusCode === 200){ if(response.statusCode === 200){
fulfill(body) fulfill(body)
} else { } else {
reject() reject(response.body)
} }
}) })
}) })