Fix OAuth token fetch failures from ad-hoc response persistence (#399)

This commit is contained in:
Gregory Schier
2026-02-19 14:04:34 -08:00
committed by GitHub
parent 7b73401dcf
commit 5a184c1b83
3 changed files with 93 additions and 76 deletions

View File

@@ -61,6 +61,10 @@ export async function fetchAccessToken(
console.log('[oauth2] Got access token response', resp.status);
if (resp.error) {
throw new Error(`Failed to fetch access token: ${resp.error}`);
}
const body = resp.bodyPath ? readFileSync(resp.bodyPath, 'utf8') : '';
if (resp.status < 200 || resp.status >= 300) {