Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/thegoleffect/passport int…
Browse files Browse the repository at this point in the history
…o fw-support
  • Loading branch information
jaredhanson committed Feb 27, 2013
2 parents 93310fd + f7297c9 commit f639d4c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/passport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function Passport() {
this._serializers = [];
this._deserializers = [];
this._infoTransformers = [];
this._plugin = null;

this._userProperty = 'user';

Expand Down Expand Up @@ -104,6 +105,10 @@ Passport.prototype.initialize = function(options) {
options = options || {};
this._userProperty = options.userProperty || 'user';

if (this._plugin && this._plugin.initialize) {
return this._plugin.initialize().bind(this);
}

return initialize().bind(this);
}

Expand Down Expand Up @@ -170,6 +175,10 @@ Passport.prototype.session = function() {
* @api public
*/
Passport.prototype.authenticate = function(strategy, options, callback) {
if (this._plugin && this._plugin.authenticate) {
return this._plugin.authenticate(strategy, options, callback).bind(this);
}

return authenticate(strategy, options, callback).bind(this);
}

Expand Down Expand Up @@ -409,4 +418,4 @@ exports.strategies.SessionStrategy = SessionStrategy;
/**
* HTTP extensions.
*/
require('./http/request');
require('./http/request');

0 comments on commit f639d4c

Please sign in to comment.