How to use the openid.loadDiscoveredInformation function in openid

To help you get started, we’ve selected a few openid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jaredhanson / passport-openid / lib / passport-openid / index.js View on Github external
*     })
 *
 * @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) {
github CodeArtemis / TriggerRally / server / node_modules / passport-google / node_modules / passport-openid / lib / passport-openid / index.js View on Github external
*     })
 *
 * @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) {
github CodeArtemis / TriggerRally / server / node_modules / passport-google / node_modules / passport-openid / lib / passport-openid / index.js View on Github external
*
 * @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);
github jaredhanson / passport-openid / lib / passport-openid / strategy.js View on Github external
Strategy.prototype.loadDiscoveredInformation = function(fn) {
  openid.loadDiscoveredInformation = fn;
  return this;  // return this for chaining
}
github CodeArtemis / TriggerRally / server / node_modules / passport-google / node_modules / passport-openid / lib / passport-openid / strategy.js View on Github external
Strategy.prototype.loadDiscoveredInformation = function(fn) {
  openid.loadDiscoveredInformation = fn;
  return this;  // return this for chaining
}
github jaredhanson / passport-openid / lib / passport-openid / index.js View on Github external
*
 * @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);