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.
Problem
The mobile app currently performs authenticated API requests independently across multiple screens by manually attaching
Authorizationheaders inside components.Examples found in:
CardsScreen.tsxConnectPlatformsScreen.tsxDevCardViewScreen.tsxHomeScreen.tsxLinksScreen.tsxCurrent implementation issues:
401/403) response handlingAt 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:
Suggested fix
Introduce a shared authenticated API utility/interceptor layer for mobile requests.
Possible improvements:
401/403) handlingThis would improve maintainability, scalability, and overall session reliability for the mobile app.