Fix IP Bans

This commit is contained in:
calzoneman 2014-03-02 22:00:24 -06:00
parent f75b6b754d
commit db5b407635
3 changed files with 9 additions and 5 deletions

View File

@ -430,12 +430,12 @@ Channel.prototype.getIPRank = function (ip, callback) {
return;
}
var rank = res.reduce(function (a, b) {
var globalRank = res.reduce(function (a, b) {
return Math.max(a, b);
}, 0);
if (!self.registered) {
callback(null, rank);
callback(null, globalRank);
return;
}
@ -452,7 +452,7 @@ Channel.prototype.getIPRank = function (ip, callback) {
var rank = res.reduce(function (a, b) {
return Math.max(a, b);
}, rank);
}, globalRank);
callback(null, rank);
});

View File

@ -350,7 +350,7 @@ module.exports = {
return;
}
callback(null, rows);
callback(null, rows.map(function (r) { return r.rank; }));
});
},

View File

@ -42,7 +42,11 @@ function handleLogin(req, res) {
});
} else {
var auth = user.name + ":" + user.hash;
console.log(Config.get("http.root-domain-dotted"));
res.cookie("auth", auth, {
expires: new Date(Date.now() + 7*24*60*60*1000),
httpOnly: true
});
res.cookie("auth", auth, {
domain: Config.get("http.root-domain-dotted"),
expires: new Date(Date.now() + 7*24*60*60*1000),