Files
automatisch/packages/backend/src/apps/strava/common/add-auth-header.js
2024-01-05 17:44:21 +01:00

12 lines
267 B
JavaScript

const addAuthHeader = ($, requestConfig) => {
const { accessToken, tokenType } = $.auth.data;
if (accessToken && tokenType) {
requestConfig.headers.Authorization = `${tokenType} ${accessToken}`;
}
return requestConfig;
};
export default addAuthHeader;