mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -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
ab85db4426
commit
75637708c0
1 changed files with 2 additions and 1 deletions
|
@ -170,6 +170,8 @@ exports.restartServer = async () => {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.use(cookieParser(settings.sessionKey, {}));
|
||||||
|
|
||||||
exports.sessionMiddleware = expressSession({
|
exports.sessionMiddleware = expressSession({
|
||||||
secret: settings.sessionKey,
|
secret: settings.sessionKey,
|
||||||
store: new SessionStore(),
|
store: new SessionStore(),
|
||||||
|
@ -212,7 +214,6 @@ exports.restartServer = async () => {
|
||||||
// call `next('route')` which will skip the remaining middlewares in this list.
|
// call `next('route')` which will skip the remaining middlewares in this list.
|
||||||
webaccess.nextRouteIfPreAuthorized,
|
webaccess.nextRouteIfPreAuthorized,
|
||||||
exports.sessionMiddleware,
|
exports.sessionMiddleware,
|
||||||
cookieParser(settings.sessionKey, {}),
|
|
||||||
webaccess.checkAccess,
|
webaccess.checkAccess,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue