Skip to content

[Bug] auth.ts returns generic Login failed message with no error differentiation #798

Description

@RUKAYAT-CODER

Overview

auth.ts catches all login errors and returns the same "Login failed. Please try again." message regardless of the underlying cause (wrong password, account suspended, server error, network timeout). Users cannot take the correct corrective action.

Specifications

Features:

  • Map HTTP status codes and error codes to specific user-facing messages
  • 401 → "Incorrect email or password", 403 → "Account suspended. Contact support", 0/network → "Check your internet connection"

Tasks:

  • Define a getLoginErrorMessage(error: AxiosError): string function
  • Replace the generic catch with structured error mapping
  • Write tests for each error code mapping

Impacted Files:

  • src/services/auth.ts
  • src/utils/authErrors.ts

Acceptance Criteria

  • Each error type displays a distinct, actionable message
  • Network errors prompt connectivity check
  • Account lockout directs to support
  • All mappings covered by unit tests

Metadata

Metadata

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