File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -211,21 +211,20 @@ export const App = ({
211211 )
212212 } , [ logoComponent , projectRoot , theme ] )
213213
214- // Derive auth reachability + retrying state inline from authQuery error
214+ // Derive auth reachability + retrying state from authQuery error
215215 const authError = authQuery . error
216216 const authErrorStatusCode = authError ? getErrorStatusCode ( authError ) : undefined
217- const isRetryableNetworkError = authErrorStatusCode !== undefined && isRetryableStatusCode ( authErrorStatusCode )
218217
219218 let authStatus : AuthStatus = 'ok'
220- if ( authQuery . isError ) {
221- // Only show network status if it's a server/network error (5xx)
222- if ( authErrorStatusCode === undefined || authErrorStatusCode < 500 ) {
223- authStatus = 'ok'
224- } else if ( isRetryableNetworkError ) {
219+ if ( authQuery . isError && authErrorStatusCode !== undefined ) {
220+ if ( isRetryableStatusCode ( authErrorStatusCode ) ) {
221+ // Retryable errors (408 timeout, 429 rate limit, 5xx server errors)
225222 authStatus = 'retrying'
226- } else {
223+ } else if ( authErrorStatusCode >= 500 ) {
224+ // Non-retryable server errors (unlikely but possible future codes)
227225 authStatus = 'unreachable'
228226 }
227+ // 4xx client errors (401, 403, etc.) keep 'ok' - network is fine, just auth failed
229228 }
230229
231230 // Render login modal when not authenticated AND auth service is reachable
You can’t perform that action at this time.
0 commit comments