Add req to EJS render args when possible

This makes it possible for EJS templates and `eejsBlock_*` hook
functions to access the user's express-session state.
This commit is contained in:
Richard Hansen 2020-10-31 20:15:27 -04:00 committed by John McLear
parent cf43156390
commit ed5a635f4c
4 changed files with 11 additions and 14 deletions

View file

@ -3,7 +3,7 @@ var eejs = require('ep_etherpad-lite/node/eejs');
exports.expressCreateServer = function (hook_name, args, cb) {
args.app.get('/admin', function(req, res) {
if('/' != req.path[req.path.length-1]) return res.redirect('./admin/');
res.send( eejs.require("ep_etherpad-lite/templates/admin/index.html", {}) );
res.send(eejs.require('ep_etherpad-lite/templates/admin/index.html', {req}));
});
return cb();
}