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

Error failing to create if response is missing headers #70

Closed ischu closed 4 years ago

ischu commented 4 years ago

Please consider changing line 595 in OAuthClient.js from
e.intuit_tid = (authResponse && authResponse.headers().intuit_tid) || ''; to e.intuit_tid = (authResponse && authResponse.headers() && authResponse.headers().intuit_tid) || '';

Something was wrong with the response header and I was getting "TypeError: Cannot read property 'intuit_tid' of undefined" instead of the error returned by Intuit. I added the additional short circuit and now I can see the original error.