feat: add defineApp and beforeRequest

This commit is contained in:
Ali BARIN
2022-10-17 23:29:20 +02:00
parent 314787f39c
commit 1760c6e454
7 changed files with 60 additions and 21 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;