Skip to content

Commit

Permalink
Merge 416abce into 882d65e
Browse files Browse the repository at this point in the history
  • Loading branch information
pragmaticivan committed Dec 31, 2018
2 parents 882d65e + 416abce commit fc26c6d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/sessionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function SessionManager(options, serializeUser) {
options = undefined;
}
options = options || {};

this._key = options.key || 'passport';
this._serializeUser = serializeUser;
}
Expand All @@ -23,7 +23,16 @@ SessionManager.prototype.logIn = function(req, user, cb) {
req.session = {};
}
req.session[self._key] = req._passport.session;
cb();
if (typeof req.session.save == 'function') {
req.session.save(function (err) {
if (err) {
return cb(err);
}
cb();
});
} else {
cb();
}
});
}

Expand Down

0 comments on commit fc26c6d

Please sign in to comment.