Skip to content

Commit

Permalink
Stylistic edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Dec 9, 2019
1 parent 4cce2f2 commit 380b5c8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/middleware/authenticate.js
Expand Up @@ -61,7 +61,7 @@ var http = require('http')
*
* passport.authenticate('twitter');
*
* @param {String|Array|Object} name
* @param {Strategy|String|Array} name
* @param {Object} options
* @param {Function} callback
* @return {Function}
Expand Down Expand Up @@ -182,15 +182,15 @@ module.exports = function authenticate(passport, name, options, callback) {
// Get the strategy, which will be used as prototype from which to create
// a new instance. Action functions will then be bound to the strategy
// within the context of the HTTP request/response pair.
var prototype ;
if( typeof layer === 'object'){
prototype = layer;
}else{
var strategy, prototype;
if (typeof layer.authenticate == 'function') {
strategy = layer;
} else {
prototype = passport._strategy(layer);
if (!prototype) { return next(new Error('Unknown authentication strategy "' + layer + '"')); }

strategy = Object.create(prototype);
}
if (!prototype) { return next(new Error('Unknown authentication strategy "' + layer + '"')); }

var strategy = Object.create(prototype);


// ----- BEGIN STRATEGY AUGMENTATION -----
Expand Down

0 comments on commit 380b5c8

Please sign in to comment.