Problem
The mobile authentication flow currently does not persist user sessions across app restarts.
Inside apps/mobile/src/context/AuthContext.tsx, the auth provider contains TODO placeholders for loading and saving tokens, but no actual persistence implementation exists.
Current behavior:
- User logs in successfully
- App state holds token temporarily
- Restarting the app clears authentication state
- User must log in again every launch
Evidence
// TODO: Load token from secure storage on app start
useEffect(() => {
setIsLoading(false);
}, []);
Expected behavior
- Authentication token should persist securely across app restarts
- Existing user sessions should be restored automatically on launch
- Logout should properly clear persisted auth state
- App should remain authenticated until token expiry or explicit logout
Suggested fix
Implement persistent auth storage using either:
expo-secure-store
@react-native-async-storage/async-storage
Possible implementation flow:
- Save token during login
- Restore token inside initial
useEffect
- Re-fetch user profile if token exists
- Clear token on logout
This would significantly improve mobile UX and session continuity.
Why this matters
Currently the app behaves like a stateless session on mobile.
For a production mobile application, users generally expect:
- persistent login
- seamless relaunch experience
- session continuity
Re-authenticating on every app restart creates unnecessary friction.
Problem
The mobile authentication flow currently does not persist user sessions across app restarts.
Inside
apps/mobile/src/context/AuthContext.tsx, the auth provider contains TODO placeholders for loading and saving tokens, but no actual persistence implementation exists.Current behavior:
Evidence
Expected behavior
Suggested fix
Implement persistent auth storage using either:
expo-secure-store@react-native-async-storage/async-storagePossible implementation flow:
useEffectThis would significantly improve mobile UX and session continuity.
Why this matters
Currently the app behaves like a stateless session on mobile.
For a production mobile application, users generally expect:
Re-authenticating on every app restart creates unnecessary friction.