docs: function (req, _callback, raw)
      {
          Strophe.info("_connect_cb was called");
  
          this.connected = true;
  
          var bodyWrap = this._proto._reqToData(req);
          if (!bodyWrap) { return; }
  
          if (this.xmlInput !== Strophe.Connection.prototype.xmlInput) {
              if (bodyWrap.nodeName === this._proto.strip && bodyWrap.childNodes.length) {
                  this.xmlInput(bodyWrap.childNodes[0]);
              } else {
                  this.xmlInput(bodyWrap);
              }
          }
          if (this.rawInput !== Strophe.Connection.prototype.rawInput) {
              if (raw) {
                  this.rawInput(raw);
              } else {
                  this.rawInput(Strophe.serialize(bodyWrap));
              }
          }
  
          var conncheck = this._proto._connect_cb(bodyWrap);
          if (conncheck === Strophe.Status.CONNFAIL) {
              return;
          }
  
          this._authentication.sasl_scram_sha1 = false;
          this._authentication.sasl_plain = false;
          this._authentication.sasl_digest_md5 = false;
          this._authentication.sasl_anonymous = false;
  
          this._authentication.legacy_auth = false;
  
          // Check for the stream:features tag
          var hasFeatures = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "features").length > 0;
          var mechanisms = bodyWrap.getElementsByTagName("mechanism");
          var matched = [];
          var i, mech, found_authentication = false;
          if (!hasFeatures) {
              this._proto._no_auth_received(_callback);
              return;
          }
          if (mechanisms.length > 0) {
              for (i = 0; i < mechanisms.length; i++) {
                  mech = Strophe.getText(mechanisms[i]);
                  if (this.mechanisms[mech]) matched.push(this.mechanisms[mech]);
              }
          }
          this._authentication.legacy_auth =
              bodyWrap.getElementsByTagName("auth").length > 0;
          found_authentication = this._authentication.legacy_auth ||
              matched.length > 0;
          if (!found_authentication) {
              this._proto._no_auth_received(_callback);
              return;
          }
          if (this.do_authentication !== false)
              this.authenticate(matched);
      }