From ab779253fd4afca09a1ebd59c5859919b37dccfc Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Fri, 15 Nov 2024 10:20:43 +0700 Subject: [PATCH] Chore: Fix SonarQube Quality Gate --- processor/src/commercetools/auth.commercetools.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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', };