Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* })
*
* @param {Function} fn
* @api public
*/
exports.discover = function(fn) {
discoverers.push(fn);
};
var discoverers = [];
/**
* Swizzle the underlying loadDiscoveredInformation function in the openid
* module.
*/
var loadDiscoveredInformation = openid.loadDiscoveredInformation;
openid.loadDiscoveredInformation = function(key, callback) {
var stack = discoverers;
(function pass(i, err, provider) {
// an error occurred or a provider was found, done
if (err || provider) { return callback(err, provider); }
var discover = stack[i];
if (!discover) {
// The list of custom discovery functions has been exhausted. Call the
// original implementation provided by the openid module.
return loadDiscoveredInformation(key, callback);
}
try {
discover(key, function(e, p) { pass(i + 1, e, p); });
} catch(e) {
* })
*
* @param {Function} fn
* @api public
*/
exports.discover = function(fn) {
discoverers.push(fn);
};
var discoverers = [];
/**
* Swizzle the underlying loadDiscoveredInformation function in the openid
* module.
*/
var loadDiscoveredInformation = openid.loadDiscoveredInformation;
openid.loadDiscoveredInformation = function(key, callback) {
var stack = discoverers;
(function pass(i, err, provider) {
// an error occurred or a provider was found, done
if (err || provider) { return callback(err, provider); }
var discover = stack[i];
if (!discover) {
// The list of custom discovery functions has been exhausted. Call the
// original implementation provided by the openid module.
return loadDiscoveredInformation(key, callback);
}
try {
discover(key, function(e, p) { pass(i + 1, e, p); });
} catch(e) {
*
* @param {Function} fn
* @api public
*/
exports.discover = function(fn) {
discoverers.push(fn);
};
var discoverers = [];
/**
* Swizzle the underlying loadDiscoveredInformation function in the openid
* module.
*/
var loadDiscoveredInformation = openid.loadDiscoveredInformation;
openid.loadDiscoveredInformation = function(key, callback) {
var stack = discoverers;
(function pass(i, err, provider) {
// an error occurred or a provider was found, done
if (err || provider) { return callback(err, provider); }
var discover = stack[i];
if (!discover) {
// The list of custom discovery functions has been exhausted. Call the
// original implementation provided by the openid module.
return loadDiscoveredInformation(key, callback);
}
try {
discover(key, function(e, p) { pass(i + 1, e, p); });
} catch(e) {
return callback(e);
Strategy.prototype.loadDiscoveredInformation = function(fn) {
openid.loadDiscoveredInformation = fn;
return this; // return this for chaining
}
Strategy.prototype.loadDiscoveredInformation = function(fn) {
openid.loadDiscoveredInformation = fn;
return this; // return this for chaining
}
*
* @param {Function} fn
* @api public
*/
exports.discover = function(fn) {
discoverers.push(fn);
};
var discoverers = [];
/**
* Swizzle the underlying loadDiscoveredInformation function in the openid
* module.
*/
var loadDiscoveredInformation = openid.loadDiscoveredInformation;
openid.loadDiscoveredInformation = function(key, callback) {
var stack = discoverers;
(function pass(i, err, provider) {
// an error occurred or a provider was found, done
if (err || provider) { return callback(err, provider); }
var discover = stack[i];
if (!discover) {
// The list of custom discovery functions has been exhausted. Call the
// original implementation provided by the openid module.
return loadDiscoveredInformation(key, callback);
}
try {
discover(key, function(e, p) { pass(i + 1, e, p); });
} catch(e) {
return callback(e);