I want allow only those users who are signed in to forgot their password in AWS Cognito? But don't know how to get registered users to check :(

Viewed 13

this code will send code to every email but I need to send only to registered users.

  cognitoUser.forgotPassword({
    onSuccess: function(result) {
        console.log('call result: ' + result);
    },
    onFailure: function(err) {
        alert(err);
    },
    inputVerificationCode() { 
        var verificationCode = prompt('Please input verification code ', '');
        var newPassword = prompt('Enter new password ', '');
        cognitoUser.confirmPassword(verificationCode, newPassword, this);
    }
    });
   }
0 Answers
Related