Change login timeout
This commit is contained in:
parent
8313e7b006
commit
63055c51a2
|
@ -128,8 +128,6 @@ module.exports.initGlobalTables = function () {
|
|||
"PRIMARY KEY (`visit_id`), INDEX (`ip`))",
|
||||
fail("aliases"));
|
||||
|
||||
// TODO actionlog? or no?
|
||||
|
||||
query("CREATE TABLE IF NOT EXISTS `stats` (" +
|
||||
"`time` BIGINT NOT NULL," +
|
||||
"`usercount` INT NOT NULL," +
|
||||
|
@ -138,6 +136,20 @@ module.exports.initGlobalTables = function () {
|
|||
"PRIMARY KEY (`time`))" +
|
||||
"CHARACTER SET utf8",
|
||||
fail("stats"));
|
||||
|
||||
query("CREATE TABLE IF NOT EXISTS `meta` (" +
|
||||
"`key` VARCHAR(255) NOT NULL," +
|
||||
"`value` TEXT NOT NULL," +
|
||||
"PRIMARY KEY (`key`))" +
|
||||
"CHARACTER SET utf8",
|
||||
function (err, res) {
|
||||
if (err) {
|
||||
fail("meta")(err);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO select/update appropriate values
|
||||
});
|
||||
};
|
||||
|
||||
/* REGION global bans */
|
||||
|
|
|
@ -39,7 +39,7 @@ function handleLogin(req, res) {
|
|||
});
|
||||
} else {
|
||||
res.cookie("auth", user.name + ":" + user.hash, {
|
||||
expires: new Date(Date.now() + 60*60*1000),
|
||||
expires: new Date(Date.now() + 7*24*60*60*1000),
|
||||
httpOnly: true
|
||||
});
|
||||
|
||||
|
|
|
@ -36,10 +36,7 @@ function sendJade(res, view, locals) {
|
|||
});
|
||||
cache[view] = fn;
|
||||
}
|
||||
var start = Date.now();
|
||||
var html = cache[view](merge(locals));
|
||||
var end = Date.now();
|
||||
console.log(view + " " + (end - start) + "ms");
|
||||
res.send(html);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue