Closed moimikey closed 8 years ago
meh, just went the wrapper route. if anyones interested:
const getRequestToken = () => {
return new Promise((resolve, reject) => {
return oa.getOAuthRequestToken((err, requestToken, requestSecret) => {
if (err) return reject(err)
return resolve({
requestToken,
requestSecret
})
})
})
}
const getAccessToken = ({ requestToken, requestSecret }) => {
return new Promise((resolve, reject) => {
return oa.getOAuthAccessToken({
oauth_token: requestToken,
oauth_token_secret: requestSecret
}, (err, authToken, authSecret) => {
if (err) return reject(err)
return resolve({
authToken,
authSecret
})
})
})
}
return await getAccessToken(await getRequestToken())
any interest in adding support for Promise? trying to avoid callbacks for an SDK that i'm building so I can take advantage of async/await.