注册时唯一的用户名和唯一的电子邮件放大 Cognito React

问题描述

我正在做 React 项目。 我遇到的问题是, 我可以创建唯一的用户名或唯一的电子邮件。 如果我选择唯一的用户名我可以用同一个电子邮件注册多个帐户但我不会那样做,如果我选择电子邮件唯一的用户名是由 aws 自动生成的 这也不是我想要的。 有没有可能的方法让我可以让唯一的用户选择用户名和唯一的电子邮件。 如果可能的话,我希望这在 CloudFormation file amplify/backend/auth/{projectname}/template.yaml

期间以编程方式发生
# BEGIN USER POOL RESOURCES
  UserPool:
  # Created upon user selection
  # Depends on SNS Role for Arn if MFA is enabled
    Type: AWS::Cognito::UserPool
    UpdateReplacePolicy: Retain
    Properties:
      UserPoolName: !If [ShouldNotCreateEnvResources,!Ref userPoolName,!Join ['',[!Ref userPoolName,'-',!Ref env]]]
      
      
      UsernameConfiguration:
        CaseSensitive: false
      
      Schema:
        
        -
          Name: email
          required: true
          Mutable: true
        
      
      
      
      AutoVerifiedAttributes: !Ref autoVerifiedAttributes
      
      
      EmailVerificationMessage: !Ref emailVerificationMessage
      EmailVerificationSubject: !Ref emailVerificationSubject
      
      Policies:
        PasswordPolicy:
          MinimumLength: !Ref passwordPolicyMinLength
          RequireLowercase: false
          RequireNumbers: false
          RequireSymbols: false
          RequireUppercase: false
      
      MfaConfiguration: !Ref mfaConfiguration
      SmsverificationMessage: !Ref smsverificationMessage
      SmsAuthenticationMessage: !Ref smsAuthenticationMessage
      SmsConfiguration:
        SnsCallerArn: !GetAtt SNSRole.Arn
        ExternalId: dogeco219bfa38_role_external_id
    
  

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)