diff --git a/lib/http/request.js b/lib/http/request.js index 58efb3aa..9bb27e42 100644 --- a/lib/http/request.js +++ b/lib/http/request.js @@ -51,7 +51,13 @@ req.logIn = function(user, options, done) { * @api public */ req.logout = -req.logOut = function(done) { +req.logOut = function(options, done) { + if (typeof options == 'function') { + done = options; + options = {}; + } + options = options || {}; + var property = this._userProperty || 'user'; this[property] = null; diff --git a/lib/sessionmanager.js b/lib/sessionmanager.js index 0c43e5b3..30323033 100644 --- a/lib/sessionmanager.js +++ b/lib/sessionmanager.js @@ -9,7 +9,13 @@ function SessionManager(options, serializeUser) { this._serializeUser = serializeUser; } -SessionManager.prototype.logIn = function(req, user, cb) { +SessionManager.prototype.logIn = function(req, user, options, cb) { + if (typeof options == 'function') { + cb = options; + options = {}; + } + options = options || {}; + console.log('SM: logIn'); if (!req.session) { return cb(new Error('Login sessions require session support. Did you forget to use `express-session` middleware?')); } @@ -44,7 +50,13 @@ SessionManager.prototype.logIn = function(req, user, cb) { }); } -SessionManager.prototype.logOut = function(req, cb) { +SessionManager.prototype.logOut = function(req, options, cb) { + if (typeof options == 'function') { + cb = options; + options = {}; + } + options = options || {}; + console.log('SM: logOut'); if (!req.session) { return cb(new Error('Login sessions require session support. Did you forget to use `express-session` middleware?')); }