logout method

Future<void> logout()

Signs the user out by calling the logout endpoint and cleaning up local auth data.

Server-side logout failures are swallowed — local cleanup always proceeds. Emits AuthenticationStatus.unauthenticated before clearing data to prevent a transient authenticated-with-empty-user state.

Implementation

Future<void> logout() async {
  _logger.info('[AuthRepository] Logout requested');
  try {
    // TODO: swap getDummyLogout() → logout() when API is ready
    await _authService.getDummyLogout();
  } catch (e, st) {
    _logger.warn('[AuthRepository] Server logout failed (continuing local cleanup)', error: e, stackTrace: st);
  }
  await _forceLogout();
}