diff --git a/processor/src/commercetools/auth.commercetools.ts b/processor/src/commercetools/auth.commercetools.ts index 79b68fe..473ea13 100644 --- a/processor/src/commercetools/auth.commercetools.ts +++ b/processor/src/commercetools/auth.commercetools.ts @@ -5,8 +5,10 @@ import fetch from 'node-fetch'; export const getAccessToken = async (): Promise => { const config = readConfiguration(); + const credentials = btoa(config.commerceTools.clientId + ':' + config.commerceTools.clientSecret); + const headers = { - Authorization: `Basic ${btoa(`${config.commerceTools.clientId}:${config.commerceTools.clientSecret}`)}`, + Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json', };