diff --git a/packages/netlify-cms-lib-util/src/API.ts b/packages/netlify-cms-lib-util/src/API.ts index 0b2eb3cd..f8ad4a8c 100644 --- a/packages/netlify-cms-lib-util/src/API.ts +++ b/packages/netlify-cms-lib-util/src/API.ts @@ -69,7 +69,9 @@ export const requestWithBackoff = async ( } return response; } catch (err) { - if (attempt <= 5) { + if (attempt > 5 || err.message === "Can't refresh access token when using implicit auth") { + throw err; + } else { if (!api.rateLimiter) { const timeout = err.resetSeconds || attempt * attempt; console.log( @@ -87,8 +89,6 @@ export const requestWithBackoff = async ( }, 1000 * timeout); } return requestWithBackoff(api, req, attempt + 1); - } else { - throw err; } } };