submitSelfServiceLogoutFlowWithoutBrowser method

Future<Response<void>> submitSelfServiceLogoutFlowWithoutBrowser({
  1. required SubmitSelfServiceLogoutFlowWithoutBrowserBody submitSelfServiceLogoutFlowWithoutBrowserBody,
  2. CancelToken? cancelToken,
  3. Map<String, dynamic>? headers,
  4. Map<String, dynamic>? extra,
  5. ValidateStatus? validateStatus,
  6. ProgressCallback? onSendProgress,
  7. ProgressCallback? onReceiveProgress,
})

Perform Logout for APIs, Services, Apps, ... Use this endpoint to log out an identity using an Ory Session Token. If the Ory Session Token was successfully revoked, the server returns a 204 No Content response. A 204 No Content response is also sent when the Ory Session Token has been revoked already before. If the Ory Session Token is malformed or does not exist a 403 Forbidden response will be returned. This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.

Parameters:

  • submitSelfServiceLogoutFlowWithoutBrowserBody
  • cancelToken - A CancelToken that can be used to cancel the operation
  • headers - Can be used to add additional headers to the request
  • extras - Can be used to add flags to the request
  • validateStatus - A ValidateStatus callback that can be used to determine request success based on the HTTP status of the response
  • onSendProgress - A ProgressCallback that can be used to get the send progress
  • onReceiveProgress - A ProgressCallback that can be used to get the receive progress

Returns a Future Throws DioError if API call or serialization fails

Implementation

Future<Response<void>> submitSelfServiceLogoutFlowWithoutBrowser({
  required SubmitSelfServiceLogoutFlowWithoutBrowserBody submitSelfServiceLogoutFlowWithoutBrowserBody,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final _path = r'/self-service/logout/api';
  final _options = Options(
    method: r'DELETE',
    headers: <String, dynamic>{
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[],
      ...?extra,
    },
    contentType: 'application/json',
    validateStatus: validateStatus,
  );

  dynamic _bodyData;

  try {
    const _type = FullType(SubmitSelfServiceLogoutFlowWithoutBrowserBody);
    _bodyData = _serializers.serialize(submitSelfServiceLogoutFlowWithoutBrowserBody, specifiedType: _type);

  } catch(error, stackTrace) {
    throw DioError(
       requestOptions: _options.compose(
        _dio.options,
        _path,
      ),
      type: DioErrorType.other,
      error: error,
    )..stackTrace = stackTrace;
  }

  final _response = await _dio.request<Object>(
    _path,
    data: _bodyData,
    options: _options,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );

  return _response;
}