fix(dropbox): don't add old token in refresh token logic

This commit is contained in:
Ali BARIN
2023-04-07 11:58:06 +00:00
parent 1dc46dd31c
commit 5d2134db56
2 changed files with 4 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ const refreshToken = async ($: IGlobalVariable) => {
params, params,
headers: { headers: {
Authorization: `Basic ${basicAuthToken}` Authorization: `Basic ${basicAuthToken}`
},
additionalProperties: {
skipAddingAuthHeader: true
} }
} }
); );

View File

@@ -3,7 +3,7 @@ import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => { const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
requestConfig.headers['Content-Type'] = 'application/json'; requestConfig.headers['Content-Type'] = 'application/json';
if (!requestConfig.headers.Authorization && $.auth.data?.accessToken) { if (!requestConfig.additionalProperties?.skipAddingAuthHeader && $.auth.data?.accessToken) {
requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`; requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`;
} }