小编Lui*_*dez的帖子

自动确认用户 Cognito + Node JS

我尝试在 cognito + Node Js 应用程序中自动确认我的用户。我尝试将此代码作为 Util,并在函数内部;并且无法让它发挥作用

我尝试查看 aws 文档,但代码不明确并且没有解释太多。

这是我的代码:

userPool.signUp(req.body.email, req.body.password, attributeList, 
null, function (err, result) {
  event = {
    request: {
      "userAttributes": {
        "email": req.body.email
      },
      "validationData": {
        "Name": "email",
        "Value": req.body.email
      }
    },
    response: { 
      autoVerifyEmail: true
    }
  }
  // Confirm the user

  // Set the email as verified if it is in the request
  if (event.request.userAttributes.hasOwnProperty("email")) {
      event.response.autoVerifyEmail = 'true';
  }

  // Return to Amazon Cognito
  callback(null, event);

if (err) {
  console.log("Error aws: ", err.message); …
Run Code Online (Sandbox Code Playgroud)

api node.js amazon-cognito

1
推荐指数
1
解决办法
6654
查看次数

标签 统计

amazon-cognito ×1

api ×1

node.js ×1