mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 13:32:06 +07:00
fix: resolve variable hoisting and add auth debug logs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user