feat: Convert all app files to JS
This commit is contained in:
15
packages/backend/src/apps/zendesk/common/add-auth-headers.js
Normal file
15
packages/backend/src/apps/zendesk/common/add-auth-headers.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
const { instanceUrl, tokenType, accessToken } = $.auth.data;
|
||||
|
||||
if (instanceUrl) {
|
||||
requestConfig.baseURL = instanceUrl;
|
||||
}
|
||||
|
||||
if (tokenType && accessToken) {
|
||||
requestConfig.headers.Authorization = `${tokenType} ${$.auth.data.accessToken}`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default addAuthHeader;
|
Reference in New Issue
Block a user