mirror of
https://github.com/thelounge/thelounge
synced 2024-11-11 07:04:18 +00:00
Prevent multiple logins
This commit is contained in:
parent
53643782b0
commit
2e964ca629
2 changed files with 14 additions and 16 deletions
|
@ -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) {
|
||||
|
|
|
@ -152,9 +152,7 @@ function auth(data) {
|
|||
}
|
||||
});
|
||||
if (!success) {
|
||||
if (!data.token) {
|
||||
socket.emit("auth");
|
||||
}
|
||||
socket.emit("auth");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue