twitter-lite icon indicating copy to clipboard operation
twitter-lite copied to clipboard

getting type errors with TokenResponse

Open hedcet opened this issue 5 years ago • 1 comments

I'm getting some type error with the destructuring assignment

Screenshot 2020-07-31 at 3 56 18 AM

maybe error in here https://github.com/draftbit/twitter-lite/blob/master/index.d.ts#L158

hedcet avatar Jul 30 '20 22:07 hedcet

Please try this:

const oauthResult = await client.getRequestToken(callbackUrl)

if (oauthResult.oauth_callback_confirmed === 'true') {
  // in this scope you can access oauth_token and oauth_token_secret
  console.log(oauthResult.oauth_token)
} else {
  // in this scope oauth_token and oauth_token_secret are not available
  throw new Error('oauth_callback_confirmed is not "true".')
}

ciffelia avatar Aug 12 '21 12:08 ciffelia