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

react
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
selectedAccount: null,
authenticationDatabase: {}
@ -82,12 +82,12 @@ exports.load = function(){
/**
* 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.
*/
exports.getClientToken = function(def = false){
return !def ? config.clientToken : DEFAULT_CONFIG.clientToken
exports.getClientToken = function(){
return config.clientToken
}
/**

View File

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