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({
428428 error ,
429429 ) ;
430430
431- // Check for auth-related errors
431+ const shouldRetry = await handleAuthError ( error ) ;
432+ if ( shouldRetry ) {
433+ return connect ( undefined , retryCount + 1 ) ;
434+ }
432435 const is401Error =
433436 ( error instanceof SseError && error . code === 401 ) ||
434437 ( error instanceof Error && error . message . includes ( '401' ) ) ||
435438 ( error instanceof Error && error . message . includes ( 'Unauthorized' ) ) ;
436439
437440 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- }
443441 // Don't set error state if we're about to redirect for auth
442+
444443 return ;
445444 }
446445 throw error ;
You can’t perform that action at this time.
0 commit comments