doSignIn(username, password) {
    const { auth } = this.props;
    let showMFAPrompt = false;

    return new Promise(async (outResolve, reject) => {
      this.resolver = outResolve;

      const session = await new Promise((resolve) => {
        auth.handleSignIn(username, password, auth.loginCallbackFactory({
          onSuccess(session) {
            console.log('loginCallbacks.onSuccess', session);
            resolve(session);
          },
          onFailure(err) {
            console.log('loginCallbacks.onFailure', err);
            reject(new Error(err.invalidCredentialsMessage || err.message || err));
          },
          newPasswordRequired(data) {
            reject(new Error('newPasswordRequired'));
          },
          mfaRequired(challengeName, challengeParameters) {
            showMFAPrompt = true;
            resolve();
          },
        }, this));
      });

      this.setState({ showMFAPrompt }, () => {
        if (session) {
          this.resolver(session);
        }
      });
    });
  }
Signs in a user with a username.password combination. If needed, takes care of MFA.

@param {string} username 
@param {string} password