I am working on a workflow for my Cognito user pool to allow users to change their email. So far I have it working to where the email change is pushed to Cognito using AdminUpdateUserAttributes and a verification email is sent to the user at the new email.
public async Task AdminUpdateUserEmail (
string username,
string userPoolId,
string email)
{
AdminUpdateUserAttributesRequest adminUpdateUserAttributesRequest = new AdminUpdateUserAttributesRequest
{
Username = username,
UserPoolId = userPoolId,
UserAttributes = new List<AttributeType>
{
new AttributeType()
{
Name = "email",
Value = email
}
}
};
AdminUpdateUserAttributesResponse adminUpdateUserAttributesResponse = adminAmazonCognitoIdentityProviderClient
.AdminUpdateUserAttributesAsync(adminUpdateUserAttributesRequest)
.Result;
}
Initially we were sending a Code, but we are now wanting to test sending a link instead to see if it will make the workflow a bit easier. Ideally, sending the link will make it so the email verification will be handled by Cognito rather than by us using VerifyUserAttribute.
In order to change to using a link instead of a code, I went into my User Pool's Messaging tab and changed the Verification Message template to use Link instead of Code.
Even after making this change, however, I still receive a code when I try to change the email for an account.
Based on all the documentation I've seen, this seems to be an uncomplicated change and I've only seen one report of this issue when I was trying to find solutions online which wound up being tied to a third party so it wasn't really very helpful.
Am I missing a step or doing something wrong here? If there is anything else you need to help answer my question, let me know.
I have not, so far nothing is working for me.