validateSession method

Future<TValidateSessionResponse> validateSession({
  1. required TValidateSessionBody input,
})

Produce a SignedRequest from ProxyTGetWalletKitConfigBody by using the client's stamp function.

See also: GetWalletKitConfig. Validate a session token. Used internally by API Gateway for cookie-based authentication.

Sign the provided TValidateSessionBody with the client's stamp function and submit the request (POST /internal/v1/validate_session).

See also: stampValidateSession.

Implementation

/// Validate a session token. Used internally by API Gateway for cookie-based authentication.
///
/// Sign the provided `TValidateSessionBody` with the client's `stamp` function and submit the request (POST /internal/v1/validate_session).
///
/// See also: `stampValidateSession`.

Future<TValidateSessionResponse> validateSession({
  required TValidateSessionBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_VALIDATE_SESSION',
  );
  return await request<Map<String, dynamic>, TValidateSessionResponse>(
      "/internal/v1/validate_session",
      body,
      (json) => TValidateSessionResponse.fromJson(
          transformActivityResponse(json, 'ValidateSession')));
}