AWS Cognito - 创建用户而不向他们发送验证电子邮件

Jay*_*Jay 5 javascript amazon-web-services node.js amazon-cognito

我正在尝试为我自己注册的某些用户(管理员)禁用验证过程。

我已经添加了预注册 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);
Run Code Online (Sandbox Code Playgroud)

};

并且电子邮件验证仍在向用户发送。

我还尝试使用adminConfirmSignUp api 在我使用adminCreateUser创建用户后立即确认用户。但这是我在使用adminConfirmSignUp时遇到的错误

{ NotAuthorizedException:无法确认用户。当前状态为 FORCE_CHANGE_PASSWORD

有没有其他方法可以使我不向某些用户发送验证电子邮件?