Update yggdrasil.js to fix bug

This fixes a crash that occurs on line 310 of index.js where it tries to read the value of client.session.selectedProfile.id which doesn't exist if the session was acquired by a refresh with old auth details.
This commit is contained in:
Frase 2014-11-22 21:01:59 +08:00
parent 09cdf6c77d
commit bcbcf5ef7f

View File

@ -20,7 +20,8 @@ function getSession(username, password, clientToken, refresh, cb) {
var session = { var session = {
accessToken: resp.body.accessToken, accessToken: resp.body.accessToken,
clientToken: resp.body.clientToken, clientToken: resp.body.clientToken,
username: resp.body.selectedProfile.name username: resp.body.selectedProfile.name,
selectedProfile: resp.body.selectedProfile
}; };
cb(null, session); cb(null, session);
} else { } else {
@ -100,4 +101,4 @@ exports.getSession = getSession;
exports.joinServer = joinServer; exports.joinServer = joinServer;
exports.validateSession = validateSession; exports.validateSession = validateSession;
exports.generateUUID = require("node-uuid").v4; exports.generateUUID = require("node-uuid").v4;
exports.loginType = "yggdrasil"; exports.loginType = "yggdrasil";