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
fix: createToken requests
  • Loading branch information
benflap committed Nov 23, 2023
commit 65290fc45ba5118733c2081476e57891936786bb
8 changes: 4 additions & 4 deletions src/OAuthClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ OAuthClient.prototype.createToken = function createToken(uri) {

const request = {
url: OAuthClient.tokenEndpoint,
body,
data: body,
method: 'POST',
headers: {
Authorization: `Basic ${this.authHeader()}`,
Expand Down Expand Up @@ -383,15 +383,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 @@ -552,7 +552,7 @@ OAuthClient.prototype.validateToken = function validateToken() {
* @returns response
*/
OAuthClient.prototype.loadResponse = function loadResponse(request) {
return axios.get(request).then((response) => response);
return axios(request).then((response) => response);
};

/**
Expand Down