Node.js AWS Cognito ResendConfirmationCode未发送电子邮件代码-节点/JS
我正在使用AWS Cognito,并试图允许用户重新发送初始注册确认电子邮件(即他们注册,并在电子邮件验证链接上丢失/忘记/等待太久)。当他们注册时,它发送电子邮件没有问题。当我为注册并确认有效的用户使用下面的代码时 但是,如果我使用下面的方法尝试为未确认的用户重新发送初始电子邮件确认链接,它将返回正确的结果,但电子邮件从未发送。请您帮助以正确的方式重新发送初始电子邮件确认。谢谢Node.js AWS Cognito ResendConfirmationCode未发送电子邮件代码-节点/JS,node.js,amazon-cognito,Node.js,Amazon Cognito,我正在使用AWS Cognito,并试图允许用户重新发送初始注册确认电子邮件(即他们注册,并在电子邮件验证链接上丢失/忘记/等待太久)。当他们注册时,它发送电子邮件没有问题。当我为注册并确认有效的用户使用下面的代码时 但是,如果我使用下面的方法尝试为未确认的用户重新发送初始电子邮件确认链接,它将返回正确的结果,但电子邮件从未发送。请您帮助以正确的方式重新发送初始电子邮件确认。谢谢 { "CodeDeliveryDetails": { "AttributeName": "ema
{
"CodeDeliveryDetails": {
"AttributeName": "email",
"DeliveryMedium": "email",
"Destination": "the email address is here"
}
}
resendConfirmationCode(用户名:字符串):承诺{
返回新承诺((解决、拒绝)=>{
const cognitoUser=this.getUserByUsername(用户名);
cognitoUser.resendConfirmationCode((错误:任意,结果:任意)=>{
如果(错误){
拒绝(错误);
}否则{
决心(结果);
}
});
});
}
resendConfirmationCode(userName: string): Promise<any> {
return new Promise((resolve, reject) => {
const cognitoUser = this.getUserByUsername(userName);
cognitoUser.resendConfirmationCode((error: any, result: any) => {
if (error) {
reject(error);
} else {
resolve(result);
}
});
});
}