Smiled_One
Smiled_One

Reputation: 465

change email username on cognito aws

Users are login using Cognito to our app and the email is used as username. The PM asked for the option to change username but, seems like AWS doesn't give that option.

const res = await cognito.adminUpdateUserAttributes({UserPoolId:userPoolId, Username:body.uuid, UserAttributes:[{Name:'email', Value:body.newEmail}]}).promise();
return createResponse(200, 'ok');

Now it returns empty response without errors but I don't see the user email changed, I also tried to add email_verified:true but nothing happened. Anyone knows a workaround?

Upvotes: 1

Views: 2000

Answers (1)

Rangeesh
Rangeesh

Reputation: 363

1.Only option for you to do here is either migrate to a new pool while migrating change the username. 2.If you want to change the login username continuously you can use username or preferred username as alias for the cognito. There is option while configuring and cannot be changed after pool is created.

Upvotes: 2

Related Questions