Below is my pool config using aws-sdk in javascript, i am unable to get how to enable required flow through code not from aws console?
const userPoolConfig = {
Policies: {
PasswordPolicy: {
MinimumLength: 8,
RequireUppercase: true,
RequireLowercase: true,
RequireNumbers: true,
RequireSymbols: true,
TemporaryPasswordValidityDays: 7,
},
},
UsernameAttributes: ['email'], //changed from AliasAttributes to UsernameAttributes
UsernameConfiguration: {
CaseSensitive: false,
},
DeletionProtection: 'ACTIVE',
MfaConfiguration: 'OFF',
AdminCreateUserConfig: {
AllowAdminCreateUserOnly: true,
},
EmailConfiguration: {
EmailSendingAccount: 'COGNITO_DEFAULT', // Disable automatic email sending or 'DEVELOPER', with ARN SourceArn: 'your-source-arn'
// SourceArn: 'arn:aws:ses:ap-south-1:929476570592:identity/dummy@example.com'
},
Schema: [
{
AttributeDataType: 'String',
DeveloperOnlyAttribute: false,
Mutable: false,
Name: 'sub',
Required: true,
StringAttributeConstraints: {
MaxLength: '200',
MinLength: '1',
},
},
{
AttributeDataType: 'String',
DeveloperOnlyAttribute: false,
Mutable: true,
Name: 'name',
Required: false,
StringAttributeConstraints: {
MaxLength: '35',
MinLength: '0',
},
},
{
AttributeDataType: 'String',
DeveloperOnlyAttribute: false,
Mutable: true,
Name: 'email',
Required: false,
StringAttributeConstraints: {
MaxLength: '200',
MinLength: '0',
},
},
{
AttributeDataType: 'String',
DeveloperOnlyAttribute: false,
Mutable: true,
Name: 'phone_number',
Required: false,
StringAttributeConstraints: {
MaxLength: '2048',
MinLength: '0',
},
},
// Add more custom attributes if needed
],
UserPoolTags: {
// You can add tags here if needed
},
UserPoolAddOns: {
AdvancedSecurityMode: 'ENFORCED', // Enable token revocation and prevent user existence errors
},
};