Skip to content

Commit

Permalink
Use utils-merge rather than Object.assign for compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed May 20, 2022
1 parent 4f6bd5b commit 8dd79fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/sessionmanager.js
@@ -1,3 +1,5 @@
var merge = require('utils-merge');

function SessionManager(options, serializeUser) {
if (typeof options == 'function') {
serializeUser = options;
Expand Down Expand Up @@ -33,7 +35,7 @@ SessionManager.prototype.logIn = function(req, user, options, cb) {
return cb(err);
}
if (options.keepSessionInfo) {
Object.assign(req.session, prevSession);
merge(req.session, prevSession);
}
if (!req.session[self._key]) {
req.session[self._key] = {};
Expand Down Expand Up @@ -83,7 +85,7 @@ SessionManager.prototype.logOut = function(req, options, cb) {
return cb(err);
}
if (options.keepSessionInfo) {
Object.assign(req.session, prevSession);
merge(req.session, prevSession);
}
cb();
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -36,7 +36,8 @@
"main": "./lib",
"dependencies": {
"passport-strategy": "1.x.x",
"pause": "0.0.1"
"pause": "0.0.1",
"utils-merge": "^1.0.1"
},
"devDependencies": {
"make-node": "0.3.x",
Expand Down

0 comments on commit 8dd79fe

Please sign in to comment.