B2G/gecko/services/aitc/modules/browserid.js
// Received a list of emails from BrowserID for current user
Received a list of emails from BrowserID for current user
Received a list of emails from BrowserID for current user
function _gotEmails(emails, sandbox, cb, options) {
    let keys = Object.keys(emails);
    if (!keys.length) {
      sandbox.free();
      let err = "User is not logged in, or no emails were found";
      this._log.error(err);
      try {
        cb(new Error(err), null);
      } catch(e) {
        this._log.warn("Callback threw in _gotEmails " +
                       CommonUtils.exceptionStr(e));
      }
      return;
    }
    if (options.requiredEmail) {
      this._getAssertionWithEmail(
        sandbox, cb, options.requiredEmail, options.audience
      );
      return;
    }
    if (options.sameEmailAs) {
      this._getAssertionWithDomain(
        sandbox, cb, options.sameEmailAs, options.audience
      );
      return;
    }
    this._getAssertionWithEmail(
      sandbox, cb, keys[0], options.audience
    );
    return;
  }
function _gotEmails ( emails , sandbox , cb , options ) { let keys = Object . keys ( emails ) ; if ( ! keys . length ) { sandbox . free ( ) ; let err = "User is not logged in, or no emails were found" ; this . _log . error ( err ) ; try { cb ( new Error ( err ) , null ) ; } catch ( e ) { this . _log . warn ( "Callback threw in _gotEmails " + CommonUtils . exceptionStr ( e ) ) ; } return ; } if ( options . requiredEmail ) { this . _getAssertionWithEmail ( sandbox , cb , options . requiredEmail , options . audience ) ; return ; } if ( options . sameEmailAs ) { this . _getAssertionWithDomain ( sandbox , cb , options . sameEmailAs , options . audience ) ; return ; } this . _getAssertionWithEmail ( sandbox , cb , keys [ 0 ] , options . audience ) ; return ; }
Received a list of emails from BrowserID for current user
Received a list of emails from BrowserID for current user
// If list is empty, user is not logged in, or doesn't have a default email. // User is logged in. For which email shall we get an assertion? // Case 1: Explicitely provided // Case 2: Derive from a given domain // Case 3: Default email