Can users change email when using the email login option on AWS Cognito

Viewed 76
1 Answers
output, err := cognitoClient.IDP.AdminUpdateUserAttributes(&cognitoidentityprovider.AdminUpdateUserAttributesInput{
    Username: aws.String(username),
    UserAttributes: []*cognitoidentityprovider.AttributeType{
        {
            Name:  aws.String("email"),
            Value: aws.String(username),
        },
    },
    UserPoolId: aws.String(cognitoClient.UserPoolID),
})

In your case aws.String(email) should work.

or

output, err := cognitoClient.IDP.UpdateUserAttributes(&cognitoidentityprovider.UpdateUserAttributesInput{
        AccessToken: aws.String(accessToken),
        UserAttributes: []*cognitoidentityprovider.AttributeType{
            {
                Name:  aws.String("email"),
                Value: aws.String(username),
            },
        },
})
Related