Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in AWS by (5.6k points)

I am using AWS Cognito's forgot password API and it is working fine. But I am facing an issue when  I sign up with the mobile number, and later on, I add an email attribute to that user pool record and call forgot password API it sends a verification code on the 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.

1 Answer

0 votes
by (12.4k points)

Check user details using get_user

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

You can also refer to the documentation here

Want to become AWS Expert? Come & join AWS Certification.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Browse Categories

...