Search code examples
reactjsamazon-web-servicesamazon-cognitoaws-amplify

AWS Cognito: How to prevent collection of phone number?


I have a React app with AWS Amplify integration. When adding auth via Cognito, I do not want to collect phone numbers when signing up people, but I cannot change the settings of the user pool (since it has been created automatically in the amplify add auth process.

How can I prevent phone number collection?


Solution

  • Run:

    amplify add auth
    

    Next, in your generated -cloudformation-template.yml in the directory amplify/backend/auth// make sure that you have the following:

    Schema:
      - Name: phone_number
        Required: false
    

    This will make the phone_number optional.