small fix
This commit is contained in:
parent
13eb077329
commit
85ae0ede85
1 changed files with 5 additions and 6 deletions
|
|
@ -428,19 +428,18 @@ export function useConnection({
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check for auth-related errors
|
const shouldRetry = await handleAuthError(error);
|
||||||
|
if (shouldRetry) {
|
||||||
|
return connect(undefined, retryCount + 1);
|
||||||
|
}
|
||||||
const is401Error =
|
const is401Error =
|
||||||
(error instanceof SseError && error.code === 401) ||
|
(error instanceof SseError && error.code === 401) ||
|
||||||
(error instanceof Error && error.message.includes('401')) ||
|
(error instanceof Error && error.message.includes('401')) ||
|
||||||
(error instanceof Error && error.message.includes('Unauthorized'));
|
(error instanceof Error && error.message.includes('Unauthorized'));
|
||||||
|
|
||||||
if (is401Error) {
|
if (is401Error) {
|
||||||
console.log("Detected 401 error, attempting OAuth flow");
|
|
||||||
const shouldRetry = await handleAuthError(error);
|
|
||||||
if (shouldRetry) {
|
|
||||||
return connect(undefined, retryCount + 1);
|
|
||||||
}
|
|
||||||
// Don't set error state if we're about to redirect for auth
|
// Don't set error state if we're about to redirect for auth
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue