I'm unable to receive an SMS from using resendConfirmationCode
method from amazon-cognito-identity-js
. Even thought the request was sent successfully with a sample response of
{
AttributeName: "phone_number",
DeliveryMedium: "SMS",
Destination: "+*******xxxx"
}
I have the following code that will be called once a user submit a form.
function resendConfirmationCode(username) {
const cognitoUser = new CognitoUser({
Username: username,
Pool: userPool,
});
return new Promise((resolve, reject) => {
cognitoUser.resendConfirmationCode(function (err, result) {
if (err) reject(err);
resolve(result);
});
});
}
From my perspective, I think my code works well. I have done signUp
, and the SMS got sent if the user was new. However, when I used the resendConfirmationCode
I got the above response. I have already verified my phone number in Amazon SNS Sandbox. Is there something I missed?