verifyUserAttribute method

Future<void> verifyUserAttribute({
  1. required String accessToken,
  2. required String attributeName,
  3. required String code,
})

Verifies the specified user attributes in the user pool.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw CodeMismatchException. May throw ExpiredCodeException. May throw NotAuthorizedException. May throw TooManyRequestsException. May throw LimitExceededException. May throw PasswordResetRequiredException. May throw UserNotFoundException. May throw UserNotConfirmedException. May throw InternalErrorException.

Parameter accessToken : Represents the access token of the request to verify user attributes.

Parameter attributeName : The attribute name in the request to verify user attributes.

Parameter code : The verification code in the request to verify user attributes.

Implementation

Future<void> verifyUserAttribute({
  required String accessToken,
  required String attributeName,
  required String code,
}) async {
  ArgumentError.checkNotNull(accessToken, 'accessToken');
  ArgumentError.checkNotNull(attributeName, 'attributeName');
  _s.validateStringLength(
    'attributeName',
    attributeName,
    1,
    32,
    isRequired: true,
  );
  ArgumentError.checkNotNull(code, 'code');
  _s.validateStringLength(
    'code',
    code,
    1,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.VerifyUserAttribute'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    signed: false,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccessToken': accessToken,
      'AttributeName': attributeName,
      'Code': code,
    },
  );
}