mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-10 08:55:00 -04:00
express: Move up cookie-parser
middleware
This makes it possible for the `preAuthorize` and `preExpressSession` hooks to easily read or set cookies.
This commit is contained in:
parent
9b3a1d7167
commit
220b7f0e5a
1 changed files with 2 additions and 1 deletions
|
@ -170,6 +170,8 @@ exports.restartServer = async () => {
|
|||
}));
|
||||
}
|
||||
|
||||
app.use(cookieParser(settings.sessionKey, {}));
|
||||
|
||||
exports.sessionMiddleware = expressSession({
|
||||
secret: settings.sessionKey,
|
||||
store: new SessionStore(),
|
||||
|
@ -212,7 +214,6 @@ exports.restartServer = async () => {
|
|||
// call `next('route')` which will skip the remaining middlewares in this list.
|
||||
webaccess.nextRouteIfPreAuthorized,
|
||||
exports.sessionMiddleware,
|
||||
cookieParser(settings.sessionKey, {}),
|
||||
webaccess.checkAccess,
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue