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
124 stars 159 forks source link

Fix PDF Generation Issue with QuickBooks API by Checking Response Body When JSON is Null #178

Closed 0xGR1M closed 2 months ago

0xGR1M commented 3 months ago

Description of Changes I encountered issues while generating invoice PDFs using the QuickBooks API. During debugging, I discovered that the authResponse was null because there was no JSON present in the response. However, the Buffer file for the PDF was present in the body field.

Proposed Solution To address this, I propose adding a check for the body field in the makeApiCall method if authResponse.json is null. This will ensure that the authResponse still sends the data back, allowing users to generate the PDF even if the JSON is null.

rajeshgupta723 commented 2 months ago

Thank you @0xNafri , the PR has been reviewed, approved and merged, much appreciated!