intuit-oauth
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -1,1 +0,1 @@ | ||
{"processes":{"9fcb920b-f4be-477c-9151-da663f7d589f":{"parent":null,"children":[]}},"files":{"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/AuthResponseTest.js":["9fcb920b-f4be-477c-9151-da663f7d589f"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/OAuthClient.js":["9fcb920b-f4be-477c-9151-da663f7d589f"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/response/AuthResponse.js":["9fcb920b-f4be-477c-9151-da663f7d589f"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/access-token/Token.js":["9fcb920b-f4be-477c-9151-da663f7d589f"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/OAuthClientTest.js":["9fcb920b-f4be-477c-9151-da663f7d589f"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/TokenTest.js":["9fcb920b-f4be-477c-9151-da663f7d589f"]},"externalIds":{}} | ||
{"processes":{"2e3512fa-21d0-4620-bcbc-42be9f7ed84e":{"parent":null,"children":[]}},"files":{"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/AuthResponseTest.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/OAuthClient.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/response/AuthResponse.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/src/access-token/Token.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/OAuthClientTest.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"],"/Users/rgupta24/Documents/GitHub/oauth-jsclient/test/TokenTest.js":["2e3512fa-21d0-4620-bcbc-42be9f7ed84e"]},"externalIds":{}} |
# Changelog | ||
## [4.1.3](https://github.com/intuit/oauth-jsclient/tree/4.1.3) | ||
#### Features | ||
- None | ||
#### Issues Fixed | ||
- [minor fixes OAuthClient.js](https://github.com/intuit/oauth-jsclient/pull/171) | ||
## [4.1.2](https://github.com/intuit/oauth-jsclient/tree/4.1.2) | ||
#### Issues Fixed | ||
- [fixed Error converting authResponse to JSON string](https://github.com/intuit/oauth-jsclient/pull/165) | ||
## [4.1.1](https://github.com/intuit/oauth-jsclient/tree/4.1.1) | ||
@@ -5,0 +14,0 @@ #### Features |
{ | ||
"name": "intuit-oauth", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "Intuit Node.js client for OAuth2.0 and OpenIDConnect", | ||
@@ -5,0 +5,0 @@ "main": "./src/OAuthClient.js", |
@@ -166,3 +166,3 @@ [![SDK Banner](views/SDK.png)][ss1] | ||
.then(function (authResponse) { | ||
console.log('The Token is ' + JSON.stringify(authResponse.getJson())); | ||
console.log('The Token is ' + JSON.stringify(authResponse.json)); | ||
}) | ||
@@ -219,3 +219,3 @@ .catch(function (e) { | ||
.then(function (authResponse) { | ||
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getJson())); | ||
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json)); | ||
}) | ||
@@ -237,3 +237,3 @@ .catch(function (e) { | ||
.then(function (authResponse) { | ||
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getJson())); | ||
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json)); | ||
}) | ||
@@ -255,3 +255,3 @@ .catch(function (e) { | ||
.then(function (authResponse) { | ||
console.log('Tokens revoked : ' + JSON.stringify(authResponse.getJson())); | ||
console.log('Tokens revoked : ' + JSON.stringify(authResponse.json)); | ||
}) | ||
@@ -272,3 +272,3 @@ .catch(function (e) { | ||
.then(function (authResponse) { | ||
console.log('Tokens revoked : ' + JSON.stringify(authResponse.getJson())); | ||
console.log('Tokens revoked : ' + JSON.stringify(authResponse.json)); | ||
}) | ||
@@ -517,6 +517,6 @@ .catch(function (e) { | ||
oauthClient.createToken(parseRedirect).then(function (authResponse) { | ||
console.log('The Token in JSON is ' + JSON.stringify(authResponse.getJson())); | ||
console.log('The Token in JSON is ' + JSON.stringify(authResponse.json)); | ||
let status = authResponse.status(); | ||
let body = authResponse.text(); | ||
let jsonResponse = authResponse.getJson(); | ||
let jsonResponse = authResponse.json; | ||
let intuit_tid = authResponse.get_intuit_tid(); | ||
@@ -523,0 +523,0 @@ }); |
@@ -185,6 +185,6 @@ /* eslint-disable no-undef */ | ||
.then((res) => { | ||
const { response, ...authResponse } = res.json ? res : null; | ||
const authResponse = res.hasOwnProperty('json')? res : null; | ||
const json = (authResponse && authResponse.json) || res; | ||
this.token.setToken(json); | ||
this.log('info', 'Create Token response is : ', JSON.stringify(authResponse.json, null, 2)); | ||
this.log('info', 'Create Token response is : ', JSON.stringify(authResponse && authResponse.json, null, 2)); | ||
return authResponse; | ||
@@ -227,6 +227,6 @@ }) | ||
.then((res) => { | ||
const { request, ...authResponse } = res.json ? res : null; | ||
const authResponse = res.hasOwnProperty('json')? res : null; | ||
const json = (authResponse && authResponse.json) || res; | ||
this.token.setToken(json); | ||
this.log('info', 'Refresh Token () response is : ', JSON.stringify(authResponse.json, null, 2)); | ||
this.log('info', 'Refresh Token () response is : ', JSON.stringify(authResponse && authResponse.json, null, 2)); | ||
return authResponse; | ||
@@ -270,3 +270,3 @@ }) | ||
.then((res) => { | ||
const { request, ...authResponse } = res.json ? res : null; | ||
const authResponse = res.hasOwnProperty('json')? res : null; | ||
const json = (authResponse && authResponse.json) || res; | ||
@@ -276,4 +276,3 @@ this.token.setToken(json); | ||
'info', | ||
'Refresh usingToken () response is : ', | ||
JSON.stringify(authResponse.json, null, 2), | ||
'Refresh usingToken () response is : ', JSON.stringify(authResponse && authResponse.json, null, 2), | ||
); | ||
@@ -323,5 +322,5 @@ return authResponse; | ||
.then((res) => { | ||
const { request, ...authResponse } = res.json ? res : null; | ||
const authResponse = res.hasOwnProperty('json')? res : null; | ||
this.token.clearToken(); | ||
this.log('info', 'Revoke Token () response is : ', JSON.stringify(authResponse.json, null, 2)); | ||
this.log('info', 'Revoke Token () response is : ', JSON.stringify(authResponse && authResponse.json, null, 2)); | ||
return authResponse; | ||
@@ -358,7 +357,6 @@ }) | ||
.then((res) => { | ||
const { request, ...authResponse } = res.json ? res : null; | ||
const authResponse = res.hasOwnProperty('json')? res : null; | ||
this.log( | ||
'info', | ||
'The Get User Info () response is : ', | ||
JSON.stringify(authResponse.json, null, 2), | ||
'The Get User Info () response is : ', JSON.stringify(authResponse && authResponse.json, null, 2), | ||
); | ||
@@ -412,4 +410,11 @@ return authResponse; | ||
.then((res) => { | ||
const { request, ...authResponse } = res.json ? res : null; | ||
const { body, ...authResponse } = res; | ||
this.log('info', 'The makeAPICall () response is : ', JSON.stringify(authResponse.json, null, 2)); | ||
if(authResponse.json === null && body) { | ||
return { | ||
...authResponse, | ||
body: body | ||
} | ||
} | ||
return authResponse; | ||
@@ -461,3 +466,3 @@ }) | ||
.then((res) => { | ||
this.log('info', 'The validateIdToken () response is : ', JSON.stringify(res, null, 2)); | ||
this.log('info', 'The validateIdToken () response is :', JSON.stringify(res, null, 2)); | ||
if (res) return true; | ||
@@ -487,4 +492,3 @@ return false; | ||
// Find the key by KID | ||
const responseBody = JSON.parse(response.body); | ||
const key = responseBody.keys.find((el) => el.kid === kid); | ||
const key = response.data.keys.find((el) => el.kid === kid); | ||
const cert = this.getPublicKey(key.n, key.e); | ||
@@ -491,0 +495,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
718331
2426