Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS cognito forgot password API issue

I am using AWS Cognito's forgot password API its working fine. But i am facing one issue. I sign up with mobile number, and later on I add email attribute to that user pool record and call forgot password API it sends verification code on mobile number, but i want it to send it on Email, how can i do this? Here is my Code.

AWS_COGNITO.forgot_password({ client_id: ENV['AWS_WEB_APP_ID'], username: 'valid username'})

The #forgot_password takes only two values in hash as per API document

Please let me know if any more information is required from me. Thanks

like image 877
Sachin Singh Avatar asked Oct 17 '22 18:10

Sachin Singh


1 Answers

Edit: As per following docs, MFA via email is not supported yet.

  1. https://github.com/aws/aws-sdk-ios/issues/382
  2. [Jan 17, 2017] https://forums.aws.amazon.com/message.jspa?messageID=762060

Check user details using get_user

If mfa_options[0].delivery_medium is 'SMS', call set_user_settings to update delivery medium to 'EMAIL'.

like image 92
Sangharsh Avatar answered Oct 21 '22 04:10

Sangharsh