feat(flowers-software): add app with authentication
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { TBeforeRequest } from '@automatisch/types';
|
||||
|
||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
const { data } = $.auth;
|
||||
|
||||
if (data?.username && data.password && data.apiKey) {
|
||||
requestConfig.headers['x-api-key'] = data.apiKey as string;
|
||||
|
||||
requestConfig.auth = {
|
||||
username: data.username as string,
|
||||
password: data.password as string,
|
||||
};
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default addAuthHeader;
|
Reference in New Issue
Block a user