mirror of https://github.com/calzoneman/sync.git
Fix IP Bans
This commit is contained in:
parent
f75b6b754d
commit
db5b407635
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -350,7 +350,7 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
|
||||
callback(null, rows);
|
||||
callback(null, rows.map(function (r) { return r.rank; }));
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue