3

We are using amazon-cognito-identity-js to manage users in a javascript application. Currently, once authenticated, a user can change their email address or phone number with cognitoUser.updateAttributes(). If that attribute is marked as verified, it will then be unverified, and we can trigger verification through cognitoUser.getAttributeVerificationCode() and it will send a confirmation code to the users phone.

Ideally, we would like to require a code BEFORE changing the attribute, much like the change password flow works. Is such an approach possible?

Andrew
  • 1,251
  • 6
  • 17
  • Don't think this is possible ootb. How is the user currently changing his attributes? Through https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminUpdateUserAttributes.html ? – Horatiu Jeflea Oct 04 '19 at 06:59
  • We're using this js library: https://www.npmjs.com/package/amazon-cognito-identity-js the update attributes api is described here: https://docs.aws.amazon.com/cognito/latest/developerguide/using-amazon-cognito-user-identity-pools-javascript-examples.html#using-amazon-cognito-user-identity-pools-javascript-examples-updating-attributes – Andrew Oct 05 '19 at 03:30
  • Hey Andrew, I just ran into exact same issue. Did you somehow solve this? – blahblah Nov 16 '20 at 15:05
  • Sadly, no - we never arrived at a solution. – Andrew Nov 18 '20 at 06:45
  • Welp thats it, I think I have to move my whole project to amplify. This just doesn't work as a system. What if they enter the wrong address by accident. – douliman Jan 25 '22 at 22:07

0 Answers0