【发布时间】:2020-03-12 16:19:44
【问题描述】:
我正在尝试为我自己注册的一些用户(管理员)禁用验证过程。
我已经添加了注册前 lambda,就像文档说的那样:
```exports.handler = (event, context, callback) => {
// Confirm the user
event.response.autoConfirmUser = true;
// Set the email as verified if it is in the request
if (event.request.userAttributes.hasOwnProperty("email")) {
event.response.autoVerifyEmail = true;
}
// Set the phone number as verified if it is in the request
if (event.request.userAttributes.hasOwnProperty("phone_number")) {
event.response.autoVerifyPhone = true;
}
// Return to Amazon Cognito
callback(null, event);
};
电子邮件验证仍在发送给用户。
我还尝试在使用 adminCreateUser 创建用户后立即使用 adminConfirmSignUp api 来确认用户。但这是我在使用 adminConfirmSignUp
时遇到的错误{ NotAuthorizedException: 无法确认用户。当前状态是 FORCE_CHANGE_PASSWORD
有没有其他方法可以不向某些用户发送验证电子邮件?
【问题讨论】:
标签: javascript node.js amazon-web-services amazon-cognito