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") { if (Notification.permission !== "granted") {
Notification.requestPermission(); Notification.requestPermission();
} }
@ -100,24 +99,22 @@ $(function() {
socket.on("init", function(data) { socket.on("init", function(data) {
if (data.networks.length === 0) { if (data.networks.length === 0) {
$("#footer").find(".connect").trigger("click"); $("#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;
});
chat.html(
render("chat", {
channels: channels
})
);
} }
sidebar.find(".networks").html(
render("network", {
networks: data.networks
})
);
var channels = $.map(data.networks, function(n) {
return n.channels;
});
chat.html(
render("chat", {
channels: channels
})
);
sidebar.find(".empty").hide(); sidebar.find(".empty").hide();
$("body").removeClass("signed-out"); $("body").removeClass("signed-out");
$("#sign-in").detach(); $("#sign-in").detach();

View File

@ -101,7 +101,7 @@ function auth(data) {
var success = false; var success = false;
_.each(manager.clients, function(client) { _.each(manager.clients, function(client) {
if (client.config.user == data.user) { 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); init(socket, client);
success = true; success = true;
} }