Files
automatisch/packages/backend/src/apps/google-forms/common/add-auth-header.ts
2023-01-03 19:06:04 +01:00

12 lines
335 B
TypeScript

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