1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

update passport to 0.6.0

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2023-09-07 08:26:13 +01:00
parent b1d2d1aea9
commit 403c313771
3 changed files with 27 additions and 1 deletions

View file

@ -6115,6 +6115,19 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
}
if (obj.args.sessiontime != null) { sessionOptions.maxAge = (obj.args.sessiontime * 60000); } // sessiontime is minutes
obj.app.use(require('cookie-session')(sessionOptions));
obj.app.use(function(request, response, next) { // Patch for passport 0.6.0 - https://github.com/jaredhanson/passport/issues/904
if (request.session && !request.session.regenerate) {
request.session.regenerate = function (cb) {
cb()
}
}
if (request.session && !request.session.save) {
request.session.save = function (cb) {
cb()
}
}
next()
});
// Handle all incoming web sockets, see if some need to be handled as web relays
obj.app.ws('/*', function (ws, req, next) {