clear stored token when refresh call returns an error

This commit is contained in:
lohxt1 2025-04-08 17:02:29 +05:30 committed by Anoop M D
parent 3a792a021c
commit 44cef9999c

View File

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