mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
express: New expressPreSession
server-side hook
This commit is contained in:
parent
0b1ec20c5c
commit
72f4ae444d
3 changed files with 34 additions and 0 deletions
|
@ -204,6 +204,10 @@ exports.restartServer = async () => {
|
|||
|
||||
// If webaccess.preAuthorize explicitly grants access, webaccess.checkAccess will skip all checks.
|
||||
app.use(webaccess.preAuthorize);
|
||||
// Give plugins an opportunity to install handlers/middleware after the preAuthorize middleware
|
||||
// but before the express-session middleware. This allows plugins to avoid creating an
|
||||
// express-session record in the database when it is not needed (e.g., public static content).
|
||||
await hooks.aCallAll('expressPreSession', {app});
|
||||
app.use(exports.sessionMiddleware);
|
||||
app.use(cookieParser(settings.sessionKey, {}));
|
||||
app.use(webaccess.checkAccess);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue