【问题标题】:Error with generating reset password email via Firebase SDK Node通过 Firebase SDK 节点生成重置密码电子邮件时出错
【发布时间】:2020-03-31 15:51:51
【问题描述】:

目前我正在尝试为忘记密码的个人实施重置链接。我不断收到一条错误消息,指出未定义 sendCustomPasswordResetEmail。我对 Firebase SDK 相当陌生,因此我们将不胜感激任何建议。这是我的功能:

exports.resetPassword = (req, res) => {
  const userEmail = req.body.email
  admin
    .auth()
    .generatePasswordResetLink(userEmail)
    .then(link => {
      // Construct password reset email template, embed the link and send
      // using custom SMTP server.
      return sendCustomPasswordResetEmail(userEmail, link)
    })
    .catch(error => {
      console.log(error)
    })
}

【问题讨论】:

  • 您必须提供 sendCustomPasswordResetEmail 的实现才能发送电子邮件。这不是 SDK 提供的 API。
  • 文档中是否有关于此的内容,或者我将如何处理?
  • 您选择实现来发送此自定义电子邮件。这超出了 Firebase 文档的范围。

标签: node.js firebase firebase-authentication firebase-admin


【解决方案1】:

您需要发送自定义电子邮件吗?否则,您可以充当客户并按照docs for web 中的说明发送正常的密码重置电子邮件。

【讨论】:

    猜你喜欢
    • 2017-01-25
    • 2010-11-21
    • 2013-04-28
    • 2021-10-24
    • 2017-10-15
    • 2018-07-21
    • 2018-05-24
    • 2015-08-13
    • 1970-01-01
    相关资源
    最近更新 更多