Cognito didn't error on missing required email

0

Hello! I was testing sign-up in my app and I expected that I would trigger a Cognito error by leaving the email field (required in my pool) blank, but to my surprise it did not error and instead created the user with '-' for their email. Is this the intended behavior?

已提问 2 年前203 查看次数
1 回答
0

Hi,

From the description of your issue it appears that you are using standard attributes for your Amazon Cognito. Standard attributes are optional by default for all users. To make an attribute required, during the user pool creation process, select the Required check box next to the attribute. From the documentation here[1] I can confirm that “When you mark a standard attribute as Required, a user can't register unless they provide a value for the attribute”.

Reference: [1]. AWS Amazon Cognito User pool attributes documentation: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html

Thank you.

AWS
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则