Skip to content

[Bug] useAuth.tsx treats all auth errors identically — no differentiated retry strategy #791

Description

@RUKAYAT-CODER

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions