Store yggdrasil login results, some use-cases need it

This commit is contained in:
roblabla 2015-08-05 21:19:01 +00:00
parent 9c35951d15
commit ff95752e45
2 changed files with 3 additions and 2 deletions

View File

@ -169,7 +169,7 @@ function createServer(options) {
function verifyUsername() {
var digest = mcHexDigest(hash);
validateSession(client.username, digest, function(err, uuid) {
validateSession(client.username, digest, function(err, uuid, profile) {
if(err) {
client.end("Failed to verify username!");
return;
@ -178,6 +178,7 @@ function createServer(options) {
// Convert to a valid UUID until the session server updates and does
// it automatically
client.uuid = client.uuid.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5");
client.profile = profile;
loginClient();
});
}

View File

@ -83,7 +83,7 @@ function validateSession(username, serverId, cb) {
.end(function(resp) {
if(resp.ok) {
if("id" in resp.body) {
cb(null, resp.body.id);
cb(null, resp.body.id, resp.body);
} else {
var myErr = new Error("Failed to verify username!");
cb(myErr);