Permalink
Browse files

Merge branch 'master' of https://github.com/thegoleffect/passport int…

…o fw-support
  • Loading branch information...
jaredhanson committed Feb 27, 2013
2 parents 93310fd + f7297c9 commit f639d4cbf0778b5777862bf93c59b2f4829c2c3a
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/passport/index.js
View
@@ -21,6 +21,7 @@ function Passport() {
this._serializers = [];
this._deserializers = [];
this._infoTransformers = [];
+ this._plugin = null;
this._userProperty = 'user';
@@ -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);
}
@@ -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);
}
@@ -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.