private createUserPool()

in infrastructure/cdk/lib/layer/securityLayer.ts [66:116]


    private createUserPool() {
        this.userPool = new Cognito.UserPool(this, this.properties.getApplicationName() + 'UserPool', {
            passwordPolicy : {
             minLength : 6,
             requireLowercase : false,
             requireUppercase : false,
             requireDigits : false,
             requireSymbols : false
            }, 
            userPoolName : this.properties.getApplicationName(),
            standardAttributes : {
                email : {
                    required : true,
                    mutable : true
                },
                website : {
                    mutable : true,
                    required : true
                }
            },
            lambdaTriggers : {
                postConfirmation : this.postRegistrationTriggerFunction
            },
            autoVerify : {
                email : true
            },
            signInAliases : {
                username : true,
                email : true
            },
            selfSignUpEnabled : true,
            userVerification : {
                emailSubject : `AlienAttack environment ${this.properties.getApplicationName()} sent your verification link`,
                emailBody : "Please click the link below to verify your email address. {##Verify Email##}",
                emailStyle : Cognito.VerificationEmailStyle.LINK
            }
        });
        this.userPool.addDomain(this.properties.getApplicationName().toLowerCase(),{
            cognitoDomain : {
                domainPrefix : this.properties.getApplicationName().toLowerCase()
            }
        });
        this.userPoolClient = new Cognito.UserPoolClient(this,this.properties.getApplicationName()+"Client",{
            userPool : this.userPool,
            generateSecret : false,
            userPoolClientName : this.properties.getApplicationName() + 'Website',
            authFlows : {
                userSrp : true
            }
        });
    }