mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 07:51:20 +02:00
Fix OAuth token fetch failures from ad-hoc response persistence (#399)
This commit is contained in:
@@ -71,6 +71,10 @@ export async function getOrRefreshAccessToken(
|
||||
httpRequest.authenticationType = 'none'; // Don't inherit workspace auth
|
||||
const resp = await ctx.httpRequest.send({ httpRequest });
|
||||
|
||||
if (resp.error) {
|
||||
throw new Error(`Failed to refresh access token: ${resp.error}`);
|
||||
}
|
||||
|
||||
if (resp.status >= 400 && resp.status < 500) {
|
||||
// Client errors (4xx) indicate the refresh token is invalid, expired, or revoked
|
||||
// Delete the token and return null to trigger a fresh authorization flow
|
||||
|
||||
Reference in New Issue
Block a user