diff --git a/packages/backend/src/apps/pipedrive/auth/refresh-token.ts b/packages/backend/src/apps/pipedrive/auth/refresh-token.ts index 42994e38..4be1185d 100644 --- a/packages/backend/src/apps/pipedrive/auth/refresh-token.ts +++ b/packages/backend/src/apps/pipedrive/auth/refresh-token.ts @@ -19,6 +19,9 @@ const refreshToken = async ($: IGlobalVariable) => { params.toString(), { headers, + additionalProperties: { + skipAddingAuthHeader: true, + }, } ); diff --git a/packages/backend/src/apps/pipedrive/common/add-auth-header.ts b/packages/backend/src/apps/pipedrive/common/add-auth-header.ts index 8e7798b8..d15b043e 100644 --- a/packages/backend/src/apps/pipedrive/common/add-auth-header.ts +++ b/packages/backend/src/apps/pipedrive/common/add-auth-header.ts @@ -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}`; }