mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-05 22:36:23 +01:00
Fix OAuth token fetch failures from ad-hoc response persistence (#399)
This commit is contained in:
1 parent
7b73401dcf
commit
5a184c1b83
3 files changed
+93
-76
No files matched your search
@@ -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