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(); error.hide();
}); });
} }
if (!token) {
body.addClass("signed-out"); 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")
@ -103,7 +104,6 @@ $(function() {
.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");
} }
} }
} }
}