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();
});
}
body.addClass("signed-out");
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")) {
return;
}
sidebar.find(".sign-in")
.click()
.end()
.find(".networks")
.html("")
.next()
.show();
}, token ? 200 : 0);
if (token) {
return;
}
sidebar.find(".sign-in")
.click()
.end()
.find(".networks")
.html("")
.next()
.show();
});
socket.on("init", function(data) {

View File

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