How to use @xmpp/base64 - 3 common examples

To help you get started, we’ve selected a few @xmpp/base64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xmppjs / xmpp.js / packages / sasl / index.js View on Github external
reject(SASLError.fromElement(element))
      } else if (element.name === 'success') {
        resolve()
      }

      entity.removeListener('nonza', handler)
    }

    entity.on('nonza', handler)

    if (mech.clientFirst) {
      entity.send(
        xml(
          'auth',
          {xmlns: NS, mechanism: mech.name},
          encode(mech.response(creds))
        )
      )
    }
  })
}
github xmppjs / xmpp.js / packages / sasl / index.js View on Github external
const handler = element => {
      if (element.attrs.xmlns !== NS) {
        return
      }

      if (element.name === 'challenge') {
        mech.challenge(decode(element.text()))
        const resp = mech.response(creds)
        entity.send(
          xml(
            'response',
            {xmlns: NS, mechanism: mech.name},
            typeof resp === 'string' ? encode(resp) : ''
          )
        )
        return
      }

      if (element.name === 'failure') {
        reject(SASLError.fromElement(element))
      } else if (element.name === 'success') {
        resolve()
      }

      entity.removeListener('nonza', handler)
    }
github xmppjs / xmpp.js / packages / sasl / index.js View on Github external
const handler = element => {
      if (element.attrs.xmlns !== NS) {
        return
      }

      if (element.name === 'challenge') {
        mech.challenge(decode(element.text()))
        const resp = mech.response(creds)
        entity.send(
          xml(
            'response',
            {xmlns: NS, mechanism: mech.name},
            typeof resp === 'string' ? encode(resp) : ''
          )
        )
        return
      }

      if (element.name === 'failure') {
        reject(SASLError.fromElement(element))
      } else if (element.name === 'success') {
        resolve()
      }

@xmpp/base64

base64 for JavaScript

ISC
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular @xmpp/base64 functions