12 lines
282 B
TypeScript
12 lines
282 B
TypeScript
import { TBeforeRequest } from '@automatisch/types';
|
|
|
|
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
|
if ($.auth.data?.apiKey) {
|
|
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
|
|
}
|
|
|
|
return requestConfig;
|
|
};
|
|
|
|
export default addAuthHeader;
|