Logout Use Case
domain/usecases
Overview
Tears down the current session: clears the cached token, drops in-memory user state, and (best-effort) tells the backend to invalidate the refresh token.
User Flow
- Controller calls LogoutUseCase().
- Repository.logout() fires POST /auth/logout (fire-and-forget).
- Local data source clears the token from secure storage.
- Returns Either<AuthFailure, Unit>.
Cases & Edge Cases
- Backend unreachable → still clear local token; never block the user from logging out.
- Local storage write fails → surface a warning but continue navigation to /login.
Code References
- lib/features/auth/domain/usecases/logout_usecase.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Logout must always succeed locally — the user expects to land on /login. Treat the network call as best-effort cleanup.