自动验证 Amazon Cognito 用户池中的用户

cdu*_*dub 3 objective-c amazon-web-services ios amazon-cognito aws-lambda

如果我不在用户池中设置电子邮件验证,我会收到以下错误:用户无法更改/重置密码:

You have not selected either email or phone number verification, so your users will not be able to recover their passwords without contacting you for support.
Run Code Online (Sandbox Code Playgroud)

我希望能够按照 ios 用户池教程中的说明用户忘记密码,但需要使用预注册 Lamba 触发器验证电子邮件。

你如何使用 lambda 触发器?我知道如何编写 Lambda 函数,但不确定如何验证电子邮件地址(以便验证所有电子邮件,我现在不在乎用户是否注册了垃圾邮件)。谢谢。

Luc*_*uca 5

您可以使用预注册触发器来确认用户的电子邮件。

exports.handler = function(event, context) {
    event.response.autoVerifyEmail = true;

    // Return result to Cognito
    context.done(null, event);
};
Run Code Online (Sandbox Code Playgroud)