Overview
useAuth.tsx passes all auth errors to getAuthErrorMessage() without categorizing them first. Network errors, credential errors, and account-locked errors all show the same generic message and offer the same (single) recovery action.
Specifications
Features:
- Categorize auth errors:
NETWORK, INVALID_CREDENTIALS, ACCOUNT_LOCKED, SESSION_EXPIRED
- Show recovery actions specific to each category (retry for network, contact support for locked)
Tasks:
- Define an
AuthErrorCategory enum
- Update
getAuthErrorMessage to accept and return the category
- Add category-specific UI in the auth error display component
Impacted Files:
src/hooks/useAuth.tsx
src/utils/authErrors.ts
Acceptance Criteria
- Each error category shows a distinct message and recovery action
- Network errors offer a "Retry" button; locked accounts offer "Contact Support"
- Error categories are covered by unit tests
Overview
useAuth.tsxpasses all auth errors togetAuthErrorMessage()without categorizing them first. Network errors, credential errors, and account-locked errors all show the same generic message and offer the same (single) recovery action.Specifications
Features:
NETWORK,INVALID_CREDENTIALS,ACCOUNT_LOCKED,SESSION_EXPIREDTasks:
AuthErrorCategoryenumgetAuthErrorMessageto accept and return the categoryImpacted Files:
src/hooks/useAuth.tsxsrc/utils/authErrors.tsAcceptance Criteria