post review fixes
This commit is contained in:

committed by
Ali BARIN

parent
3f8f022d48
commit
6e80ff4eb6
@@ -1,11 +1,8 @@
|
||||
import { TBeforeRequest } from '@automatisch/types';
|
||||
|
||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
if ($.auth.data.oInstanceUrl) {
|
||||
requestConfig.baseURL = $.auth.data.oInstanceUrl as string;
|
||||
}
|
||||
|
||||
if (requestConfig.headers && $.auth.data?.accessToken) {
|
||||
if ($.auth.data?.accessToken) {
|
||||
requestConfig.headers = requestConfig.headers || {};
|
||||
requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`;
|
||||
}
|
||||
return requestConfig;
|
||||
|
Reference in New Issue
Block a user