From 44cef9999c692429dedbfb06343cf84bb22721ae Mon Sep 17 00:00:00 2001 From: lohxt1 Date: Tue, 8 Apr 2025 17:02:29 +0530 Subject: [PATCH] clear stored token when refresh call returns an error --- packages/bruno-electron/src/utils/oauth2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/bruno-electron/src/utils/oauth2.js b/packages/bruno-electron/src/utils/oauth2.js index 917a75c72..beaee1c21 100644 --- a/packages/bruno-electron/src/utils/oauth2.js +++ b/packages/bruno-electron/src/utils/oauth2.js @@ -696,8 +696,7 @@ const refreshOauth2Token = async ({ requestCopy, collectionUid, certsAndProxyCon requests: [], // No sub-requests in this context }; debugInfo.data.push(axiosMainRequest); - - if (parsedResponseData?.error) { + if (!parsedResponseData || parsedResponseData?.error) { clearOauth2Credentials({ collectionUid, url, credentialsId }); return { collectionUid, url, credentials: null, credentialsId, debugInfo }; }