Fix login

This commit is contained in:
Mattias Erming 2014-09-14 12:13:34 -07:00
parent 66785be200
commit b52b860167
2 changed files with 15 additions and 18 deletions

View File

@ -40,7 +40,6 @@ $(function() {
};
}
// Request notification permissions if we don't already have it
if (Notification.permission !== "granted") {
Notification.requestPermission();
}
@ -100,15 +99,12 @@ $(function() {
socket.on("init", function(data) {
if (data.networks.length === 0) {
$("#footer").find(".connect").trigger("click");
return;
}
} else {
sidebar.find(".networks").html(
render("network", {
networks: data.networks
})
);
var channels = $.map(data.networks, function(n) {
return n.channels;
});
@ -117,6 +113,7 @@ $(function() {
channels: channels
})
);
}
sidebar.find(".empty").hide();
$("body").removeClass("signed-out");

View File

@ -101,7 +101,7 @@ function auth(data) {
var success = false;
_.each(manager.clients, function(client) {
if (client.config.user == data.user) {
if (bcrypt.compareSync(data.password, client.config.password)) {
if (bcrypt.compareSync(data.password || "", client.config.password)) {
init(socket, client);
success = true;
}