File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -428,19 +428,18 @@ export function useConnection({
428
428
error ,
429
429
) ;
430
430
431
- // Check for auth-related errors
431
+ const shouldRetry = await handleAuthError ( error ) ;
432
+ if ( shouldRetry ) {
433
+ return connect ( undefined , retryCount + 1 ) ;
434
+ }
432
435
const is401Error =
433
436
( error instanceof SseError && error . code === 401 ) ||
434
437
( error instanceof Error && error . message . includes ( '401' ) ) ||
435
438
( error instanceof Error && error . message . includes ( 'Unauthorized' ) ) ;
436
439
437
440
if ( is401Error ) {
438
- console . log ( "Detected 401 error, attempting OAuth flow" ) ;
439
- const shouldRetry = await handleAuthError ( error ) ;
440
- if ( shouldRetry ) {
441
- return connect ( undefined , retryCount + 1 ) ;
442
- }
443
441
// Don't set error state if we're about to redirect for auth
442
+
444
443
return ;
445
444
}
446
445
throw error ;
You can’t perform that action at this time.
0 commit comments