From a1cc1c06305f5d761cef48cc511e718ceb408805 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 13 May 2022 13:09:33 +0500 Subject: [PATCH] skip access token injection if already present --- src/config/ecencyApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/ecencyApi.ts b/src/config/ecencyApi.ts index b6c7227cd..47f92fe24 100644 --- a/src/config/ecencyApi.ts +++ b/src/config/ecencyApi.ts @@ -38,8 +38,8 @@ api.interceptors.request.use((request) => { const digitPinCode = getDigitPinCode(pin); const accessToken = decryptKey(token, digitPinCode); - if (accessToken) { - if (!request.data) { + if (accessToken && !request.data?.code ) { + if (!request.data){ request.data = {}; } request.data.code = accessToken;