Skip to content

Commit

Permalink
Update src/v0/destinations/salesforce/transform.js
Browse files Browse the repository at this point in the history
Co-authored-by: Sankeerth <[email protected]>
  • Loading branch information
shrouti1507 and sanpj2292 authored Nov 10, 2023
1 parent 4beff17 commit 9c257f0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/v0/destinations/salesforce/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ function responseBuilderSimple(
}

const response = defaultRequestConfig();
const finalHeader =
authorizationFlow === 'oauth'
? {
'Content-Type': JSON_MIME_TYPE,
Authorization: `Bearer ${authorizationData.token}`,
}
: {
'Content-Type': JSON_MIME_TYPE,
Authorization: authorizationData.token,
};
const getAuthHeader = (authInfo) => {
const { authorizationFlow, authorizationData } = authInfo;
return authorizationFlow === 'oauth'
? { Authorization: `Bearer ${authorizationData.token}` }
: { Authorization: authorizationData.token };
}

response.method = defaultPostRequestConfig.requestMethod;
response.headers = finalHeader;
Expand Down

0 comments on commit 9c257f0

Please sign in to comment.