我想在我的应用程序中创建一个验证过程(使用Meteor)
我安装了这些软件包:
standard-app-packages
accounts-ui-bootstrap-3-blaze
bootstrap-3
accounts-password
iron-router
iron-router-progress
collection2
email
我已经设置了process.env.MAIL_URL(现在只使用我的Gmail帐号)
我已设置Accounts.config:
Accounts.config({sendVerificationEmail: true, forbidClientAccountCreation: false});
当我将forbidClientAccountCreation设置为true时,我收到错误消息" Signups Forbidden"在我的帐户-ui包中。
但是,当我将其设置为false时,会创建用户,然后发送验证电子邮件,这会使整个过程变得多余。
关于我在这里可以做什么的任何提示?
答案 0 :(得分:0)
在服务器代码中,创建用户:https://docs.meteor.com/#accounts_createuser
var userId = Accounts.createUser({email: "emailaddr"})
然后发送注册和/或验证电子邮件:https://docs.meteor.com/#accounts_sendenrollmentemail
Accounts.sendEnrollmentEmail(userId, [email])