diff options
Diffstat (limited to 'src/node/hooks/express/webaccess.js')
-rw-r--r-- | src/node/hooks/express/webaccess.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node/hooks/express/webaccess.js b/src/node/hooks/express/webaccess.js index cb5a2207..2cafd271 100644 --- a/src/node/hooks/express/webaccess.js +++ b/src/node/hooks/express/webaccess.js @@ -6,6 +6,7 @@ var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); var ueberStore = require('../../db/SessionStore'); var stats = require('ep_etherpad-lite/node/stats'); var sessionModule = require('express-session'); +var cookieParser = require('cookie-parser'); //checks for basic http auth exports.basicAuth = function (req, res, next) { @@ -76,7 +77,7 @@ exports.basicAuth = function (req, res, next) { Note that the process could stop already in step 3 with a redirect to login page. */ - + authorize(function (ok) { if (ok) return next(); authenticate(function (ok) { @@ -121,6 +122,8 @@ exports.expressConfigure = function (hook_name, args, cb) { args.app.sessionStore = exports.sessionStore; args.app.use(sessionModule({secret: exports.secret, store: args.app.sessionStore, resave: true, saveUninitialized: true, name: 'express_sid' })); + args.app.use(cookieParser(settings.sessionKey, {})); + args.app.use(exports.basicAuth); } |