logout method

Future<void> logout({
  1. bool force = false,
})

Implementation

Future<void> logout({bool force = false}) async {
  final refreshToken = _refreshToken;
  if (refreshToken != null) {
    try {
      await _apiClient.revoke(refreshToken);
    } on Exception {
      if (!force) {
        rethrow;
      }
    }
  }
  await _clearSession(SessionStateChangeReason.logout);
}