retry token exchange on HTTP errors (not just network errors)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
pullfrog[bot]
parent
ac561bd4c8
commit
5e76fd86df
@@ -25874,7 +25874,10 @@ async function acquireTokenViaGitHubApp(opts) {
|
||||
}
|
||||
async function acquireNewToken(opts) {
|
||||
if (isOIDCAvailable()) {
|
||||
return await retry(() => acquireTokenViaOIDC(opts), { label: "token exchange" });
|
||||
return await retry(() => acquireTokenViaOIDC(opts), {
|
||||
label: "token exchange",
|
||||
shouldRetry: (error2) => error2 instanceof Error && (error2.name === "AbortError" || error2.message.includes("fetch failed") || error2.message.includes("ECONNRESET") || error2.message.includes("ETIMEDOUT") || error2.message.includes("Token exchange failed"))
|
||||
});
|
||||
} else {
|
||||
return await acquireTokenViaGitHubApp(opts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user