Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
PR: Release 3.0.0 package.json change in sample
  • Loading branch information
abisalehalliprasan committed May 13, 2020
commit 23c15784cd99e8ac8db2a99322959a6982a9b71c
14 changes: 6 additions & 8 deletions src/OAuthClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
'use strict';

const atob = require('atob');
// const oauthSignature = require('oauth-signature');
// const objectAssign = require('object-assign');
const Csrf = require('csrf');
const queryString = require('query-string');
const popsicle = require('popsicle');
Expand Down Expand Up @@ -67,7 +65,7 @@ function OAuthClient(config) {
level: 'info',
format: winston.format.combine(
winston.format.timestamp(),
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`),
),
transports: [
new winston.transports.File({
Expand Down Expand Up @@ -258,7 +256,7 @@ OAuthClient.prototype.refreshUsingToken = function refreshUsingToken(refresh_tok
this.log(
'info',
'Refresh usingToken () response is : ',
JSON.stringify(authResponse, null, 2)
JSON.stringify(authResponse, null, 2),
);
return authResponse;
})
Expand Down Expand Up @@ -340,7 +338,7 @@ OAuthClient.prototype.getUserInfo = function getUserInfo() {
this.log(
'info',
'The Get User Info () response is : ',
JSON.stringify(authResponse, null, 2)
JSON.stringify(authResponse, null, 2),
);
return authResponse;
})
Expand Down Expand Up @@ -369,15 +367,15 @@ OAuthClient.prototype.makeApiCall = function makeApiCall(params) {
Accept: AuthResponse._jsonContentType,
'User-Agent': OAuthClient.user_agent,
},
params.headers
params.headers,
)
: Object.assign(
{},
{
Authorization: `Bearer ${this.getToken().access_token}`,
Accept: AuthResponse._jsonContentType,
'User-Agent': OAuthClient.user_agent,
}
},
);

const request = {
Expand Down Expand Up @@ -474,7 +472,7 @@ OAuthClient.prototype.getKeyFromJWKsURI = function getKeyFromJWKsURI(id_token, k
this.log(
'error',
'The getKeyFromJWKsURI () threw an exception : ',
JSON.stringify(e, null, 2)
JSON.stringify(e, null, 2),
);
throw e;
});
Expand Down