code: function() {
          if (!this._data.session) return;
  
          let authDict = {};
          if (this._currentStage == EMAIL_STAGE_TYPE) {
              // The email can be validated out-of-band, but we need to provide the
              // creds so the HS can go & check it.
              if (this._emailSid) {
                  const idServerParsedUrl = url.parse(
                      this._matrixClient.getIdentityServerUrl(),
                  );
                  authDict = {
                      type: EMAIL_STAGE_TYPE,
                      threepid_creds: {
                          sid: this._emailSid,
                          client_secret: this._clientSecret,
                          id_server: idServerParsedUrl.host,
                      },
                  };
              }
          }
  
          this.submitAuthDict(authDict, true);
      }
docs: Poll to check if the auth session or current stage has been
  completed out-of-band. If so, the attemptAuth promise will
  be resolved.