Skip to content

Mobile app lacks centralized authenticated request handling for protected API calls #325

@Midoriya-w

Description

@Midoriya-w

Problem

The mobile app currently performs authenticated API requests independently across multiple screens by manually attaching Authorization headers inside components.

Examples found in:

  • CardsScreen.tsx
  • ConnectPlatformsScreen.tsx
  • DevCardViewScreen.tsx
  • HomeScreen.tsx
  • LinksScreen.tsx

Current implementation issues:

  • duplicated authenticated request logic across screens
  • no centralized unauthorized (401/403) response handling
  • inconsistent session failure behavior
  • stale auth state may persist after token expiry
  • future auth-related maintenance becomes harder as the app scales

At the moment, each screen is responsible for handling protected API requests separately, which increases the risk of inconsistent authentication behavior and duplicated logic throughout the mobile codebase.


Expected behavior

Authenticated API requests should:

  • use centralized request handling
  • automatically inject auth tokens
  • consistently handle invalid/expired sessions
  • clear persisted auth state on unauthorized responses
  • provide predictable authentication behavior across the app

Suggested fix

Introduce a shared authenticated API utility/interceptor layer for mobile requests.

Possible improvements:

  • centralized auth-aware request wrapper
  • shared token injection logic
  • global unauthorized (401/403) handling
  • automatic logout/session cleanup on invalid token
  • reduced duplication across screens/components

This would improve maintainability, scalability, and overall session reliability for the mobile app.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions