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,13 +87,14 @@ $(function() {
error.hide();
});
}
if (!token) {
body.addClass("signed-out");
}
var input = login.find("input[name='user']");
if (input.val() === "") {
input.val($.cookie("user") || "");
}
setTimeout(function() {
if (!body.hasClass("signed-out")) {
if (token) {
return;
}
sidebar.find(".sign-in")
@ -103,7 +104,6 @@ $(function() {
.html("")
.next()
.show();
}, token ? 200 : 0);
});
socket.on("init", function(data) {

View File

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