I am building the forget password process by using lambdas.
The process I am following is, breaking this in two different lambdas. One for starting the forgot password process and the second one for confirming the new password. (This is because of the application requirements)
The first lambda is successfully sending the email with the verification code which is fine, but it is NOT changing the Cognito user status to RESET_REQUIRED. When I follow the forgot password process from the built-in pages provided by Cognito, I can see that when a user password is reset then his status is changed to RESET_REQUIRED.
The second part of my process (second lambda) is working fine but only when the Cognito user status is RESET_REQUIRED.
So the question I have is, how can I make that the cognitoUser.forgotPassword changes the Cognito user status to RESET_REQUIRED ?
The functions I have now are the next:
1.- forgotPassword:
cognitoUser.forgotPassword({
onSuccess: function (data) {
...
},
onFailure: function(err) {
...
},
//Optional automatic callback
inputVerificationCode: function(data)
{
...
});
2.- confirmPassword:
cognitoUser.confirmPassword(event.confimationCode, event.newPassword, {
onSuccess: function (Data) {
...
},
onFailure: function (err)
{
...
}
});
Thanks in advance.