mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 07:19:45 +02:00
Fix OAuth token fetch failures from ad-hoc response persistence (#399)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user