Skip to content

Commit 20c99d2

Browse files
committed
small tweak
1 parent b440932 commit 20c99d2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cli/src/app.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)