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) => {
|
shouldRetryOnError: (error) => {
|
||||||
// Never retry on 401 Unauthorized or 409 Conflict
|
const status = error?.response?.status;
|
||||||
if (error.response?.status === 401 || error.response?.status === 409) {
|
if (status === 401 || status === 409) {
|
||||||
|
console.log('[useAuth] Blocking retry for status:', status);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Retry for other errors (network issues, 500s)
|
console.log('[useAuth] Retrying for error:', error);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user