Skip to content

Commit

Permalink
Reverted to stable Mongoose version (#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylortom authored Aug 14, 2023
2 parents facde9a + cb973f9 commit 57eda53
Show file tree
Hide file tree
Showing 4 changed files with 10,905 additions and 8,201 deletions.
14 changes: 11 additions & 3 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@ Origin.prototype.createServer = function (options, cb) {
server.use(session({
key: 'connect.sid',
secret: app.configuration.getConfig('sessionSecret'),
store: new MongoStore({ uri: db.conn.connectionUri }),
store: new MongoStore({
uri: db.conn.connectionUri,
connectionOptions: {
domainsEnabled: true,
useNewUrlParser: true,
useUnifiedTopology: true
}
}),
resave: true,
cookie: {
signed: true,
Expand All @@ -284,9 +291,10 @@ Origin.prototype.createServer = function (options, cb) {
requestDomain.add(res);
requestDomain.session = req.session;
requestDomain.on('error', next);
requestDomain.enter();
requestDomain.run(next);
// requestDomain.enter();
// requestDomain.run(next());
next();
// next();
});
server.use(auth.initialize());
server.use(auth.session());
Expand Down
2 changes: 1 addition & 1 deletion lib/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ exports = module.exports = {
if(this.shouldIgnore(req.url)) {
return next(); // route has been explicitly ignored somewhere
}
const user = app.usermanager.getCurrentUser();
const user = app.usermanager.getCurrentUser() || JSON.parse(JSON.stringify(req.session.passport.user));

if (!user || !user._id) {
return res.status(403).json({ statusCode: STATUS.NOT_AUTHENTICATED });
Expand Down
Loading

0 comments on commit 57eda53

Please sign in to comment.