verifySessionWithHttpInfo method

Future<Response> verifySessionWithHttpInfo(
  1. String sessionId, {
  2. VerifySessionRequest? verifySessionRequest,
})

Verify a session

Returns the session if it is authenticated, otherwise returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. NodeJS SDK). For more details on how networkless verification works, refer to our Session Tokens documentation.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<http.Response> verifySessionWithHttpInfo(
  String sessionId, {
  VerifySessionRequest? verifySessionRequest,
}) async {
  // ignore: prefer_const_declarations
  final path =
      r'/sessions/{session_id}/verify'.replaceAll('{session_id}', sessionId);

  // ignore: prefer_final_locals
  Object? postBody = verifySessionRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}