fix(pipedrive): Skip adding auth header for refresh token

This commit is contained in:
Faruk AYDIN
2023-09-29 11:43:45 +02:00
parent 991f593b2e
commit dbb1c42c47
2 changed files with 6 additions and 0 deletions

View File

@@ -19,6 +19,9 @@ const refreshToken = async ($: IGlobalVariable) => {
params.toString(),
{
headers,
additionalProperties: {
skipAddingAuthHeader: true,
},
}
);

View File

@@ -1,6 +1,9 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if (requestConfig.additionalProperties?.skipAddingAuthHeader)
return requestConfig;
if ($.auth.data?.accessToken) {
requestConfig.headers.Authorization = `${$.auth.data.tokenType} ${$.auth.data.accessToken}`;
}