mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 05:25:36 +07:00
chore: enhance auth debug logging
This commit is contained in:
@@ -17,11 +17,18 @@ export const useAuth = ({ middleware, redirectIfAuthenticated }: { middleware?:
|
|||||||
{
|
{
|
||||||
shouldRetryOnError: (error) => {
|
shouldRetryOnError: (error) => {
|
||||||
const status = error?.response?.status;
|
const status = error?.response?.status;
|
||||||
|
const errorDetails = {
|
||||||
|
status,
|
||||||
|
hasResponse: !!error?.response,
|
||||||
|
message: error?.message,
|
||||||
|
code: error?.code
|
||||||
|
};
|
||||||
|
|
||||||
if (status === 401 || status === 409) {
|
if (status === 401 || status === 409) {
|
||||||
console.log('[useAuth] Blocking retry for status:', status);
|
console.log('[useAuth] 🛑 Blocking retry for 401/409:', errorDetails);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log('[useAuth] Retrying for error:', error);
|
console.log('[useAuth] ⚠️ Retrying for error (Status: ' + status + '):', error);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user