skip access token injection if already present

This commit is contained in:
Nouman Tahir 2022-05-13 13:09:33 +05:00
parent 3486fb616a
commit a1cc1c0630

View File

@ -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;