Implement a 'requireSession' mode, which requires any user to have a valid session

This commit is contained in:
Jordan 2011-11-21 01:45:37 -05:00
parent 55a2f46ca9
commit 9850ba43ee
5 changed files with 49 additions and 16 deletions

View file

@ -210,9 +210,12 @@ async.waterfall([
return;
}
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/../static/pad.html");
res.sendfile(filePath, { maxAge: exports.maxAge });
hasPadAccess(req, res, function()
{
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/../static/pad.html");
res.sendfile(filePath, { maxAge: exports.maxAge });
});
});
//serve timeslider.html under /p/$padname/timeslider
@ -225,9 +228,12 @@ async.waterfall([
return;
}
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/../static/timeslider.html");
res.sendfile(filePath, { maxAge: exports.maxAge });
hasPadAccess(req, res, function()
{
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/../static/timeslider.html");
res.sendfile(filePath, { maxAge: exports.maxAge });
});
});
//serve timeslider.html under /p/$padname/timeslider