Search code examples
amazon-web-servicesaws-sdkamazon-cognito

cognito forget password flow?


I have to implement forget password in my application, first I used this code and get the OTP successfully on email.

this.cognitoUser.forgotPassword({
  onSuccess: function (data) {
    // successfully initiated reset password request
     console.log('CodeDeliveryData from forgotPassword: ' + data);
  },
  onFailure: function (err) {
  }
});

Now on the second page, I have to verify the OTP and then on the third page, I have to ask for new password. According to the docs here on callback, I have to give both otp and new password. Suggest me please how can I divide it into three steps??


Solution

  • I am on the Cognito team and this is not possible at this point since as you noted, both the OTP and the new password are passed in the same call.