meteor/accounts-base/accounts_server.js
function (methodInvocation, options) {
  for (var i = 0; i < loginHandlers.length; ++i) {
    var handler = loginHandlers[i];

    var result = tryLoginMethod(
      handler.name,
      function () {
        return handler.handler.call(methodInvocation, options);
      }
    );

    if (result)
      return result;
    else if (result !== undefined)
      throw new Meteor.Error(400, "A login handler should return a result or undefined");
  }

  return {
    type: null,
    error: new Meteor.Error(400, "Unrecognized options for login request")
  };
}
function (methodInvocation, options) {
  for (var i = 0; i < loginHandlers.length; ++i) {
    var handler = loginHandlers[i];

    var result = tryLoginMethod(
      handler.name,
      function () {
        return handler.handler.call(methodInvocation, options);
      }
    );

    if (result)
      return result;
    else if (result !== undefined)
      throw new Meteor.Error(400, "A login handler should return a result or undefined");
  }

  return {
    type: null,
    error: new Meteor.Error(400, "Unrecognized options for login request")
  };
}
function ( methodInvocation , options ) { for ( var i = 0 ; i < loginHandlers . length ; ++ i ) { var handler = loginHandlers [ i ] ; var result = tryLoginMethod ( handler . name , function ( ) { return handler . handler . call ( methodInvocation , options ) ; } ) ; if ( result ) return result ; else if ( result !== undefined ) throw new Meteor . Error ( 400 , "A login handler should return a result or undefined" ) ; } return { type : null , error : new Meteor . Error ( 400 , "Unrecognized options for login request" ) } ; }
Try all of the registered login handlers until one of them doesn't return `undefined`, meaning it handled this call to `login`. Return that return value.
Try all of the registered login handlers until one of them doesn t return undefined meaning it handled this call to login . Return that return value .