Fixed usage of opts

This commit is contained in:
Yarmo Mackenbach 2021-04-16 10:51:48 +02:00
parent b78766341f
commit 7cf509b6f5
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
2 changed files with 4 additions and 5 deletions

View file

@ -40,7 +40,7 @@ module.exports.fn = async (data, opts) => {
null,
{
Accept: 'application/json',
Authorization: `Bearer ${opts.bearerToken}`,
Authorization: `Bearer ${opts.claims.twitter.bearerToken}`,
}
)
.then(async (data) => {

View file

@ -36,7 +36,6 @@ const xmppStart = async (service, username, password) => {
const { iqCaller } = xmpp
xmpp.start()
xmpp.on('online', (address) => {
console.log('online', address.toString())
resolve({ xmpp: xmpp, iqCaller: iqCaller })
})
xmpp.on('error', (error) => {
@ -65,9 +64,9 @@ module.exports.fn = async (data, opts) => {
if (!xmpp) {
const xmppStartRes = await xmppStart(
opts.service,
opts.username,
opts.password
opts.claims.xmpp.service,
opts.claims.xmpp.username,
opts.claims.xmpp.password
)
xmpp = xmppStartRes.xmpp
iqCaller = xmppStartRes.iqCaller