注册用户后如何在aws cognito中自动验证电子邮件。稍后状态后验证Cognito中的电子邮件

时间:2020-06-11 01:34:03

标签: amazon-web-services amazon-cognito email-verification email-confirmation

我的用例:

我想在AWS Cognito中对用户进行注册,并希望用户在注册过程中继续验证过程而不验证电子邮件。

要实现这一目标,我让用户通过在Cognito Presignup触发器中添加“ autoConfirmUser”:“ true”来继续该过程

在Cognito确认后触发器中,我正在使用SES发送CustomVerificationEmail以要求他验证电子邮件地址。

当用户在SES中验证电子邮件(状态=已验证)时,我想在Cognito中将EmailVerified更新为true。 (稍后忘记密码用例)

如何以编程方式实现这一目标?像Lambda或SNS触发的东西?

我不想使用在其中提到的AWS CLI, AWS Cognito - User stuck in CONFIRMED and email_verified = false

1 个答案:

答案 0 :(得分:0)

请在Cognito预注册触发器中将autoVerifyEmail添加为true。

观察此referance

nodejs中的示例代码

"use strict";

exports.handler = async (event) => {
    event.response.autoConfirmUser = true;
    event.response.autoVerifyEmail = true; 
    return event;
};