function signIn(account) {
    let cb = Async.makeSpinningCallback();

    Logger.AssertTrue(account["username"], "Username has been found");
    Logger.AssertTrue(account["password"], "Password has been found");

    Logger.logInfo("Login user: " + account["username"] + '\n');

    let client = new FxAccountsClient();
    client.signIn(account["username"], account["password"], true).then(credentials => {
      return fxAccounts.setSignedInUser(credentials);
    }).then(() => {
      cb(null, true);
    }, error => {
      cb(error, false);
    });

    try {
      cb.wait();

      if (Weave.Status.login !== Weave.LOGIN_SUCCEEDED) {
        Logger.logInfo("Logging into Weave.");
        Weave.Service.login();
        Logger.AssertEqual(Weave.Status.login, Weave.LOGIN_SUCCEEDED,
                           "Weave logged in");
      }

      return true;
    } catch (error) {
      throw new Error("signIn() failed with: " + error.message);
    }
  }
/**
   * Wrapper to synchronize the login of a user
   *
   * @param account
   *        Account information of the user to login
   * @param account.username
   *        The username for the account (utf8)
   * @param account.password
   *        The user's password
   */
Wrapper to synchronize the login of a user
@param account
Account information of the user to login
@param account.username
The username for the account (utf8)
@param account.password
The user's password
Wrapper to synchronize the login of a user @param account Account information of the user to login @param account . username The username for the account ( utf8 ) @param account . password The user ' s password
function signIn(account) {
    let cb = Async.makeSpinningCallback();
    Logger.AssertTrue(account["username"], "Username has been found");
    Logger.AssertTrue(account["password"], "Password has been found");
    Logger.logInfo("Login user: " + account["username"] + '\n');
    let client = new FxAccountsClient();
    client.signIn(account["username"], account["password"], true).then(credentials => {
      return fxAccounts.setSignedInUser(credentials);
    }).then(() => {
      cb(null, true);
    }, error => {
      cb(error, false);
    });
    try {
      cb.wait();
      if (Weave.Status.login !== Weave.LOGIN_SUCCEEDED) {
        Logger.logInfo("Logging into Weave.");
        Weave.Service.login();
        Logger.AssertEqual(Weave.Status.login, Weave.LOGIN_SUCCEEDED,
                           "Weave logged in");
      }
      return true;
    } catch (error) {
      throw new Error("signIn() failed with: " + error.message);
    }
  }
function signIn ( account ) { let cb = Async . makeSpinningCallback ( ) ; Logger . AssertTrue ( account [ "username" ] , "Username has been found" ) ; Logger . AssertTrue ( account [ "password" ] , "Password has been found" ) ; Logger . logInfo ( "Login user: " + account [ "username" ] + '\n' ) ; let client = new FxAccountsClient ( ) ; client . signIn ( account [ "username" ] , account [ "password" ] , true ) . then ( credentials => { return fxAccounts . setSignedInUser ( credentials ) ; } ) . then ( ( ) => { cb ( null , true ) ; } , error => { cb ( error , false ) ; } ) ; try { cb . wait ( ) ; if ( Weave . Status . login !== Weave . LOGIN_SUCCEEDED ) { Logger . logInfo ( "Logging into Weave." ) ; Weave . Service . login ( ) ; Logger . AssertEqual ( Weave . Status . login , Weave . LOGIN_SUCCEEDED , "Weave logged in" ) ; } return true ; } catch ( error ) { throw new Error ( "signIn() failed with: " + error . message ) ; } }
Wrapper to synchronize the login of a user
 @param account
        Account information of the user to login
 @param account.username
        The username for the account (utf8)
 @param account.password
        The user's password
Wrapper to synchronize the login of a user @param account Account information of the user to login @param account . username The username for the account ( utf8 ) @param account . password The user ' s password