oauthLogin method

Future<TOauthLoginResponse> oauthLogin({
  1. required TOauthLoginBody input,
})

Create an Oauth session for a user.

Sign the provided TOauthLoginBody with the client's stamp function and submit the request (POST /public/v1/submit/oauth_login).

See also: stampOauthLogin.

Implementation

Future<TOauthLoginResponse> oauthLogin({
  required TOauthLoginBody 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_OAUTH_LOGIN',
  );
  return await request<Map<String, dynamic>, TOauthLoginResponse>(
      "/public/v1/submit/oauth_login",
      body,
      (json) => TOauthLoginResponse.fromJson(
          transformActivityResponse(json, 'OauthLogin')));
}