mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2025-01-10 14:39:28 -07:00
Fixed usage of opts
This commit is contained in:
parent
b78766341f
commit
7cf509b6f5
2 changed files with 4 additions and 5 deletions
|
@ -40,7 +40,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
Authorization: `Bearer ${opts.bearerToken}`,
|
Authorization: `Bearer ${opts.claims.twitter.bearerToken}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async (data) => {
|
.then(async (data) => {
|
||||||
|
|
|
@ -36,7 +36,6 @@ const xmppStart = async (service, username, password) => {
|
||||||
const { iqCaller } = xmpp
|
const { iqCaller } = xmpp
|
||||||
xmpp.start()
|
xmpp.start()
|
||||||
xmpp.on('online', (address) => {
|
xmpp.on('online', (address) => {
|
||||||
console.log('online', address.toString())
|
|
||||||
resolve({ xmpp: xmpp, iqCaller: iqCaller })
|
resolve({ xmpp: xmpp, iqCaller: iqCaller })
|
||||||
})
|
})
|
||||||
xmpp.on('error', (error) => {
|
xmpp.on('error', (error) => {
|
||||||
|
@ -65,9 +64,9 @@ module.exports.fn = async (data, opts) => {
|
||||||
|
|
||||||
if (!xmpp) {
|
if (!xmpp) {
|
||||||
const xmppStartRes = await xmppStart(
|
const xmppStartRes = await xmppStart(
|
||||||
opts.service,
|
opts.claims.xmpp.service,
|
||||||
opts.username,
|
opts.claims.xmpp.username,
|
||||||
opts.password
|
opts.claims.xmpp.password
|
||||||
)
|
)
|
||||||
xmpp = xmppStartRes.xmpp
|
xmpp = xmppStartRes.xmpp
|
||||||
iqCaller = xmppStartRes.iqCaller
|
iqCaller = xmppStartRes.iqCaller
|
||||||
|
|
Loading…
Reference in a new issue