refactor: Use beforeRequest hook with slack app

This commit is contained in:
Faruk AYDIN
2022-10-18 23:01:56 +02:00
parent 3004cf1115
commit 7422f63c62
6 changed files with 24 additions and 20 deletions

View File

@@ -0,0 +1,11 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if (requestConfig.headers && $.auth.data?.accessToken) {
requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`;
}
return requestConfig;
};
export default addAuthHeader;