logout method

Future<void> logout()

Invalidate the current admin session on the server (best-effort).

Implementation

Future<void> logout() async {
  try {
    await _client.request(
      'DELETE',
      '/api/admin/auth/session',
      authenticated: true,
    );
  } on ApiException catch (e) {
    // Already expired / missing session is fine for local sign-out.
    if (e.statusCode != 401) rethrow;
  }
}