【问题标题】:meteor - Account.forgotPassword not working, getting internal server error流星 - Account.forgotPassword 不起作用,出现内部服务器错误
【发布时间】:2016-07-25 05:28:23
【问题描述】:

我在我的流星 Accounts.forgotPassword 回调中收到令人讨厌的模糊内部服务器错误。我已经安装了accounts-base,我知道我的SMTP设置(在Meteor.startup的服务器上定义)很好,因为我可以成功调用Email.send。

这是代码。它非常通用,所以我完全不确定会出现什么问题。有什么想法吗?

var options = {};
options.email = "my@email.address";

Accounts.forgotPassword(options, function(err){
    if (err) {
        console.log("error: "+err.reason);
    } else {
        console.log("Success!");
    }
});

【问题讨论】:

  • Accounts.forgotPassword 属于 accounts-password 包。 See here.
  • 感谢 BlazeSahlzen。我安装了帐户密码,所以不是这样。我最终编写了一个自定义密码重置脚本,但如果能弄清楚到底发生了什么,那就太好了。
  • @aragorn23 你解决了这个问题吗?看起来我们两个是唯一拥有这个的人:)

标签: meteor meteor-accounts


【解决方案1】:

只需覆盖Accounts 包的电子邮件模板的from 函数:

Accounts.emailTemplates.resetPassword.from = () => 'me <me@mydomain.com>';

未来也是安全的:

Accounts.emailTemplates.from = () => 'me <me@mydomain.com>';

【讨论】:

    猜你喜欢
    • 2015-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-12
    • 1970-01-01
    • 2011-05-05
    • 2021-10-07
    相关资源
    最近更新 更多