logoutByRequest method

Future<LogoutResponse> logoutByRequest (LogoutRequest request, { SpongeRequestContext context })

Sends the logout request to the server and returns the response. Clears the auth token in the client.

Implementation

Future<LogoutResponse> logoutByRequest(LogoutRequest request,
    {SpongeRequestContext context}) async {
  return await _lock.synchronized(() async {
    LogoutResponse response = await execute(
        SpongeClientConstants.OPERATION_LOGOUT,
        request,
        (json) => LogoutResponse.fromJson(json),
        context);
    _currentAuthToken = null;

    return response;
  });
}