Skip to content

Commit 8dd79fe

Browse files
committed
Use utils-merge rather than Object.assign for compatibility.
1 parent 4f6bd5b commit 8dd79fe

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/sessionmanager.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var merge = require('utils-merge');
2+
13
function SessionManager(options, serializeUser) {
24
if (typeof options == 'function') {
35
serializeUser = options;
@@ -33,7 +35,7 @@ SessionManager.prototype.logIn = function(req, user, options, cb) {
3335
return cb(err);
3436
}
3537
if (options.keepSessionInfo) {
36-
Object.assign(req.session, prevSession);
38+
merge(req.session, prevSession);
3739
}
3840
if (!req.session[self._key]) {
3941
req.session[self._key] = {};
@@ -83,7 +85,7 @@ SessionManager.prototype.logOut = function(req, options, cb) {
8385
return cb(err);
8486
}
8587
if (options.keepSessionInfo) {
86-
Object.assign(req.session, prevSession);
88+
merge(req.session, prevSession);
8789
}
8890
cb();
8991
});

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"main": "./lib",
3737
"dependencies": {
3838
"passport-strategy": "1.x.x",
39-
"pause": "0.0.1"
39+
"pause": "0.0.1",
40+
"utils-merge": "^1.0.1"
4041
},
4142
"devDependencies": {
4243
"make-node": "0.3.x",

0 commit comments

Comments
 (0)