【问题标题】:Custom auth lambda trigger not configured未配置自定义身份验证 lambda 触发器
【发布时间】:2020-04-08 04:50:09
【问题描述】:

我正在尝试通过反应和放大来实现经典的登录/注册。 我不想使用放大反应组件,而只想使用放大的 Auth 方法。

我还想自动确认用户,所以我插入了一个预注册 lambda 函数。 一切正常,但我仍然有这个错误。

我试图拔掉我的自定义 lambda 函数,但没有任何效果。

这是我的功能:

  handleClick = async () => {
    try {
      await Auth.signUp({
        username: this.state.username,
        password: this.state.password,
        attributes: {
          email: this.state.email,
        },
      });
      await Auth.signIn({ username: this.state.username, password: this.props.password });
    } catch (err) {
      console.error(err);
    }
  };

错误是由signUp后调用signIn触发的

有人知道这个错误信息是什么意思吗?

【问题讨论】:

    标签: amazon-cognito aws-amplify


    【解决方案1】:

    您必须提供所需的属性,用户名(非空)和密码(可以非空) 确保用户名和密码变量不为空(例如:null 或 '')。

    【讨论】:

      【解决方案2】:

      也许您已经在您的用户池上创建了一个 appClient 并启用了Enable lambda trigger based custom authentication (ALLOW_CUSTOM_AUTH)。它会搜索 lambda 触发器,但您没有设置任何触发器。

      【讨论】:

        【解决方案3】:

        当我不小心输入了一个空的或未定义的密码时,我遇到了这个问题,所以请确保您没有这样做,但是您的问题可能会有所不同。

        【讨论】:

          猜你喜欢
          • 2020-05-12
          • 1970-01-01
          • 2019-11-02
          • 2021-08-17
          • 2018-03-04
          • 1970-01-01
          • 2015-03-17
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多