From c98ca995e9e778a883f969ce82d9616a4556fbe1 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Tue, 6 Jan 2026 02:51:27 +0700 Subject: [PATCH] fix: resolve variable hoisting and add auth debug logs --- src/hooks/useAuth.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts index 6037d3f..5d3a8a8 100644 --- a/src/hooks/useAuth.ts +++ b/src/hooks/useAuth.ts @@ -16,11 +16,12 @@ export const useAuth = ({ middleware, redirectIfAuthenticated }: { middleware?: }), { shouldRetryOnError: (error) => { - // Never retry on 401 Unauthorized or 409 Conflict - if (error.response?.status === 401 || error.response?.status === 409) { + const status = error?.response?.status; + if (status === 401 || status === 409) { + console.log('[useAuth] Blocking retry for status:', status); return false; } - // Retry for other errors (network issues, 500s) + console.log('[useAuth] Retrying for error:', error); return true; } }