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

11 lines
295 B
JavaScript

const addAuthHeader = ($, requestConfig) => {
if ($.auth.data?.authenticationKey) {
const authorizationHeader = `DeepL-Auth-Key ${$.auth.data.authenticationKey}`;
requestConfig.headers.Authorization = authorizationHeader;
}
return requestConfig;
};
export default addAuthHeader;