function _doLogin(aRpCaller, aOptions, aAssertion) {
    log("_doLogin: rpId:", aRpCaller.id, "origin:", aOptions.origin);

    let loginWithAssertion = function loginWithAssertion(assertion) {
      this._store.setLoginState(aOptions.origin, true, aOptions.loggedInUser);
      this._notifyLoginStateChanged(aRpCaller.id, aOptions.loggedInUser);
      aRpCaller.doLogin(assertion);
      aRpCaller.doReady();
    }.bind(this);

    if (aAssertion) {
      loginWithAssertion(aAssertion);
    } else {
      this._getAssertion(aOptions, function gotAssertion(err, assertion) {
        if (err) {
          reportError("_doLogin:", "Failed to get assertion on login attempt:", err);
          this._doLogout(aRpCaller);
        } else {
          loginWithAssertion(assertion);
        }
      }.bind(this));
    }
  }
/**
   * A utility for watch() to set state and notify the dom
   * on login
   *
   * Note that this calls _getAssertion
   */
A utility for watch() to set state and notify the dom
on login

Note that this calls _getAssertion
A utility for watch () to set state and notify the dom on login Note that this calls _getAssertion
function _doLogin(aRpCaller, aOptions, aAssertion) {
    log("_doLogin: rpId:", aRpCaller.id, "origin:", aOptions.origin);
    let loginWithAssertion = function loginWithAssertion(assertion) {
      this._store.setLoginState(aOptions.origin, true, aOptions.loggedInUser);
      this._notifyLoginStateChanged(aRpCaller.id, aOptions.loggedInUser);
      aRpCaller.doLogin(assertion);
      aRpCaller.doReady();
    }.bind(this);
    if (aAssertion) {
      loginWithAssertion(aAssertion);
    } else {
      this._getAssertion(aOptions, function gotAssertion(err, assertion) {
        if (err) {
          reportError("_doLogin:", "Failed to get assertion on login attempt:", err);
          this._doLogout(aRpCaller);
        } else {
          loginWithAssertion(assertion);
        }
      }.bind(this));
    }
  }
function _doLogin ( aRpCaller , aOptions , aAssertion ) { log ( "_doLogin: rpId:" , aRpCaller . id , "origin:" , aOptions . origin ) ; let loginWithAssertion = function loginWithAssertion ( assertion ) { this . _store . setLoginState ( aOptions . origin , true , aOptions . loggedInUser ) ; this . _notifyLoginStateChanged ( aRpCaller . id , aOptions . loggedInUser ) ; aRpCaller . doLogin ( assertion ) ; aRpCaller . doReady ( ) ; } . bind ( this ) ; if ( aAssertion ) { loginWithAssertion ( aAssertion ) ; } else { this . _getAssertion ( aOptions , function gotAssertion ( err , assertion ) { if ( err ) { reportError ( "_doLogin:" , "Failed to get assertion on login attempt:" , err ) ; this . _doLogout ( aRpCaller ) ; } else { loginWithAssertion ( assertion ) ; } } . bind ( this ) ) ; } }
A utility for watch() to set state and notify the dom
 on login
A utility for watch () to set state and notify the dom on login