Files
automatisch/packages/backend/src/apps/google-drive/common/add-auth-header.ts
2023-03-23 19:10:43 +03:00

12 lines
310 B
TypeScript

import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if ($.auth.data?.accessToken) {
requestConfig.headers.Authorization = `${$.auth.data.tokenType} ${$.auth.data.accessToken}`;
}
return requestConfig;
};
export default addAuthHeader;