Reputation: 429
I tried signing-up for an android application using AWS cognito. But, whenever I did, it showed:
Sign-up failed - 1 validation error detected: value null at userattributes.1.member.name failed to satisfy constraint: member must not be null
Upvotes: 1
Views: 2274
Reputation: 533
I encountered this problem and found it was a problem with case of the 'Name' and 'Value' keys in the object I was passing to the constructor for AdminCreateUserCommand (I'm using the JS SDK v3, but maybe this is relevant to all version of the AWS SDK).
i.e. instead of this code, which gave me the error in your question:
const command = new AdminCreateUserCommand({
Username: email,
UserPoolId: "my-user-pool-id",
DesiredDeliveryMediums: ["EMAIL"],
UserAttributes: [
{ name: "email", value: email },
{ name: "email_verified", value: true },
],
});
This worked:
const command = new AdminCreateUserCommand({
Username: email,
UserPoolId: "my-user-pool-id",
DesiredDeliveryMediums: ["EMAIL"],
UserAttributes: [
{ Name: "email", Value: email },
{ Name: "email_verified", Value: "True" },
],
});
Note the capitalisation of the keys in the UserAttributes object, and the use of "True"
instead of true
.
Upvotes: 4
Reputation: 5775
When you're signing up the user, it looks like the attributes you're passing are incomplete. Specifically, name seems to be partially null. Give that a look.
Upvotes: 0