feat: Implement send sms action of twilio

This commit is contained in:
Faruk AYDIN
2022-10-26 18:24:12 +02:00
committed by Ali BARIN
parent 4553084503
commit 7d7c96274d
4 changed files with 87 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if (
requestConfig.headers &&
$.auth.data?.accountSid &&
$.auth.data?.authToken
) {
requestConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded';
requestConfig.auth = {
username: $.auth.data.accountSid as string,
password: $.auth.data.authToken as string,
};
}
return requestConfig;
};
export default addAuthHeader;