function (elem)
    {
        // build plaintext auth iq
        var iq = $iq({type: "set", id: "_auth_2"})
            .c('query', {xmlns: Strophe.NS.AUTH})
            .c('username', {}).t(Strophe.getNodeFromJid(this.jid))
            .up()
            .c('password').t(this.pass);

        if (!Strophe.getResourceFromJid(this.jid)) {
            // since the user has not supplied a resource, we pick
            // a default one here.  unlike other auth methods, the server
            // cannot do this for us.
            this.jid = Strophe.getBareJidFromJid(this.jid) + '/strophe';
        }
        iq.up().c('resource', {}).t(Strophe.getResourceFromJid(this.jid));

        this._addSysHandler(this._auth2_cb.bind(this), null,
                            null, null, "_auth_2");

        this.send(iq.tree());

        return false;
    }
function (elem)
    {
        // build plaintext auth iq
        var iq = $iq({type: "set", id: "_auth_2"})
            .c('query', {xmlns: Strophe.NS.AUTH})
            .c('username', {}).t(Strophe.getNodeFromJid(this.jid))
            .up()
            .c('password').t(this.pass);

        if (!Strophe.getResourceFromJid(this.jid)) {
            // since the user has not supplied a resource, we pick
            // a default one here.  unlike other auth methods, the server
            // cannot do this for us.
            this.jid = Strophe.getBareJidFromJid(this.jid) + '/strophe';
        }
        iq.up().c('resource', {}).t(Strophe.getResourceFromJid(this.jid));

        this._addSysHandler(this._auth2_cb.bind(this), null,
                            null, null, "_auth_2");

        this.send(iq.tree());

        return false;
    }
function ( elem ) { // build plaintext auth iq
 var iq = $iq ( { type : "set" , id : "_auth_2" } ) . c ( 'query' , { xmlns : Strophe . NS . AUTH } ) . c ( 'username' , { } ) . t ( Strophe . getNodeFromJid ( this . jid ) ) . up ( ) . c ( 'password' ) . t ( this . pass ) ; if ( ! Strophe . getResourceFromJid ( this . jid ) ) { // since the user has not supplied a resource, we pick
 // a default one here.  unlike other auth methods, the server
 // cannot do this for us.
 this . jid = Strophe . getBareJidFromJid ( this . jid ) + '/strophe' ; } iq . up ( ) . c ( 'resource' , { } ) . t ( Strophe . getResourceFromJid ( this . jid ) ) ; this . _addSysHandler ( this . _auth2_cb . bind ( this ) , null , null , null , "_auth_2" ) ; this . send ( iq . tree ( ) ) ; return false ; }
PrivateFunction: _auth1_cb
_Private_ handler for legacy authentication.

This handler is called in response to the initial <iq type='get'/>
for legacy authentication.  It builds an authentication <iq/> and
sends it, creating a handler (calling back to _auth2_cb()) to
handle the result

Parameters:
(XMLElement) elem - The stanza that triggered the callback.

Returns:
false to remove the handler.
 /* jshint unused:false
PrivateFunction : _auth1_cb _Private_ handler for legacy authentication .
auth 2