Change login timeout

This commit is contained in:
calzoneman 2014-01-25 16:39:16 -06:00
parent 8313e7b006
commit 63055c51a2
3 changed files with 15 additions and 6 deletions

View File

@ -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 */

View File

@ -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
});

View File

@ -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);
}