Skip to content

Commit 87c55ec

Browse files
committed
Enabled logs for sample client program; optimizing test coverage
1 parent c455bc3 commit 87c55ec

File tree

6 files changed

+459
-12
lines changed

6 files changed

+459
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const parseRedirect = req.url;
163163
oauthClient
164164
.createToken(parseRedirect)
165165
.then(function (authResponse) {
166-
console.log('The Token is ' + JSON.stringify(authResponse.json));
166+
console.log('The Token is ' + JSON.stringify(authResponse.getToken()));
167167
})
168168
.catch(function (e) {
169169
console.error('The error message is :' + e.originalMessage);
@@ -192,7 +192,7 @@ if (!oauthClient.isAccessTokenValid()) {
192192
oauthClient
193193
.refresh()
194194
.then(function (authResponse) {
195-
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json));
195+
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getToken()));
196196
})
197197
.catch(function (e) {
198198
console.error('The error message is :' + e.originalMessage);
@@ -215,7 +215,7 @@ previous refresh tokens expire 24 hours after you receive a new one.
215215
oauthClient
216216
.refresh()
217217
.then(function (authResponse) {
218-
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json));
218+
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getToken()));
219219
})
220220
.catch(function (e) {
221221
console.error('The error message is :' + e.originalMessage);
@@ -232,7 +232,7 @@ You can call the below helper method to refresh tokens by explictly passing the
232232
oauthClient
233233
.refreshUsingToken('<Enter the refresh token>')
234234
.then(function (authResponse) {
235-
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json));
235+
console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getToken()));
236236
})
237237
.catch(function (e) {
238238
console.error('The error message is :' + e.originalMessage);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intuit-oauth",
3-
"version": "4.1.3",
3+
"version": "4.2",
44
"description": "Intuit Node.js client for OAuth2.0 and OpenIDConnect",
55
"main": "./src/OAuthClient.js",
66
"scripts": {

sample/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ app.get('/authUri', urlencodedParser, function (req, res) {
5656
clientSecret: req.query.json.clientSecret,
5757
environment: req.query.json.environment,
5858
redirectUri: req.query.json.redirectUri,
59+
logging: true, //NOTE: a "logs" folder will be created/used in the current working directory, this will have oAuthClient-log.log
5960
});
6061

6162
const authUri = oauthClient.authorizeUri({

0 commit comments

Comments
 (0)