confirmRegistration method

Future<bool> confirmRegistration(
  1. String confirmationCode, {
  2. bool forceAliasCreation = false,
  3. Map<String, String>? clientMetadata,
})

This is used for a certain user to confirm the registration by using a confirmation code

Implementation

Future<bool> confirmRegistration(String confirmationCode,
    {bool forceAliasCreation = false,
    Map<String, String>? clientMetadata}) async {
  final params = {
    'ClientId': pool.getClientId(),
    'ConfirmationCode': confirmationCode,
    'Username': username,
    'ForceAliasCreation': forceAliasCreation,
    'ClientMetadata': clientMetadata
  };

  if (getUserContextData() != null) {
    params['UserContextData'] = getUserContextData();
  }

  if (_clientSecretHash != null) {
    params['SecretHash'] = _clientSecretHash;
  }

  await client!.request(
      'ConfirmSignUp', await _analyticsMetadataParamsDecorator.call(params));
  return true;
}