Prevent multiple logins

This commit is contained in:
Mattias Erming 2014-10-08 22:16:10 +02:00
parent 53643782b0
commit 2e964ca629
2 changed files with 14 additions and 16 deletions

View File

@ -87,23 +87,23 @@ $(function() {
error.hide(); error.hide();
}); });
} }
body.addClass("signed-out"); if (!token) {
body.addClass("signed-out");
}
var input = login.find("input[name='user']"); var input = login.find("input[name='user']");
if (input.val() === "") { if (input.val() === "") {
input.val($.cookie("user") || ""); input.val($.cookie("user") || "");
} }
setTimeout(function() { if (token) {
if (!body.hasClass("signed-out")) { return;
return; }
} sidebar.find(".sign-in")
sidebar.find(".sign-in") .click()
.click() .end()
.end() .find(".networks")
.find(".networks") .html("")
.html("") .next()
.next() .show();
.show();
}, token ? 200 : 0);
}); });
socket.on("init", function(data) { socket.on("init", function(data) {

View File

@ -152,9 +152,7 @@ function auth(data) {
} }
}); });
if (!success) { if (!success) {
if (!data.token) { socket.emit("auth");
socket.emit("auth");
}
} }
} }
} }