File size: 344 Bytes
3206347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const addAuthHeader = ($, requestConfig) => {
  const { data } = $.auth;

  if (data?.username && data.password && data.apiKey) {
    requestConfig.headers['x-api-key'] = data.apiKey;

    requestConfig.auth = {
      username: data.username,
      password: data.password,
    };
  }

  return requestConfig;
};

export default addAuthHeader;