gpt4 book ai didi

meteor - 如何使用 Accounts.onEmailVerificationLink?

转载 作者:行者123 更新时间:2023-12-04 17:21:18 24 4
gpt4 key购买 nike

我对如何使用 Accounts.onEmailVerificationLink 有点困惑.
文档有点模棱两可:

Accounts.onEmailVerificationLink(callback)

Register a function to call when an email verification link is clicked in an email sent by Accounts.sendVerificationEmail. This function should be called in top-level code, not inside Meteor.startup().



“此函数”、回调或 Accounts.onEmailVerificationLink 的确切含义是什么?本身?

无论如何,无论我把东西放在哪里,我总是在浏览器控制台上收到此错误消息:
Accounts.onEmailVerificationLink was called more than once. Only one callback added will be executed.

最佳答案

如果您使用集合 Hook ( https://atmospherejs.com/matb33/collection-hooks ),您可以执行以下操作:

Meteor.users.after.update(function (userId, doc, fieldNames, modifier, options) {
if (!!modifier.$set) {
//check if the email was verified
if (modifier.$set['emails.$.verified'] === true) {
//do something
}
}
});

在花了一些时间尝试连接 onMailVerificationLink 之后,我发现上面的内容没有那么挑剔了。

关于meteor - 如何使用 Accounts.onEmailVerificationLink?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27500993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com