chore: enhance auth debug logging

This commit is contained in:
dyzulk
2026-01-06 02:58:18 +07:00
parent c98ca995e9
commit 3996c4500d

View File

@@ -17,11 +17,18 @@ export const useAuth = ({ middleware, redirectIfAuthenticated }: { middleware?:
{
shouldRetryOnError: (error) => {
const status = error?.response?.status;
const errorDetails = {
status,
hasResponse: !!error?.response,
message: error?.message,
code: error?.code
};
if (status === 401 || status === 409) {
console.log('[useAuth] Blocking retry for status:', status);
console.log('[useAuth] 🛑 Blocking retry for 401/409:', errorDetails);
return false;
}
console.log('[useAuth] Retrying for error:', error);
console.log('[useAuth] ⚠️ Retrying for error (Status: ' + status + '):', error);
return true;
}
}