code: function() {
          const nextStage = this._chooseStage();
          if (!nextStage) {
              throw new Error("No incomplete flows from the server");
          }
          this._currentStage = nextStage;
  
          if (nextStage == 'm.login.dummy') {
              this.submitAuthDict({
                  type: 'm.login.dummy',
              });
              return;
          }
  
          if (this._data.errcode || this._data.error) {
              this._stateUpdatedCallback(nextStage, {
                  errcode: this._data.errcode || "",
                  error: this._data.error || "",
              });
              return;
          }
  
          const stageStatus = {};
          if (nextStage == EMAIL_STAGE_TYPE) {
              stageStatus.emailSid = this._emailSid;
          }
          this._stateUpdatedCallback(nextStage, stageStatus);
      }
docs: Pick the next stage and call the callback
  
  @private
  @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found