intuit / oauth-jsclient

Intuit's NodeJS OAuth client provides a set of methods to make it easier to work with OAuth2.0 and Open ID
https://developer.intuit.com/
Apache License 2.0
121 stars 156 forks source link

revoke function response does not support getJson() #73

Closed AlbertHambardzumyan closed 4 years ago

AlbertHambardzumyan commented 4 years ago

According to Revoke access_token documentation I should be able to call getJson() on the response:

  const authResponse = await oauthClient.revoke(token)
  console.log('Token revoked', authResponse.getJson())

However, Im getting the following error: Error: AuthResponse is not JSON

Any thoughts ?

abisalehalliprasan commented 4 years ago

@AlbertHambardzumyan : The revoke() does not return the JSON. I will fix this and release a new version.

However, in the meantime you could see the status of the revoke() using : authResponse.response.status

AlbertHambardzumyan commented 4 years ago

@abisalehalliprasan I just need token itself, no need the response status at all. Turns out the response of revoke() call is the token I'm looking for.

So, I would say the documentation describes this api wrongly.

abisalehalliprasan commented 4 years ago

Welcome any PR's. I will also get this fixed in the new release. Thanks @AlbertHambardzumyan