feat(ntfy): add auth support

This commit is contained in:
Ali BARIN
2022-12-05 00:45:02 +01:00
parent 46bfc597ec
commit 6995323a45
5 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if ($.auth.data.apiBaseUrl) {
requestConfig.baseURL = $.auth.data.apiBaseUrl as string;
}
if ($.auth.data?.username && $.auth.data?.password) {
requestConfig.auth = {
username: $.auth.data.username as string,
password: $.auth.data.password as string,
}
}
return requestConfig;
};
export default addAuthHeader;