如何在Meteor中创建用户服务器端? [英] How can I create users server side in Meteor?
问题描述
在新的Meteor auth分支中,如何创建用户服务器端?
In the new Meteor auth branch how can I create users server side?
我了解如何通过调用来创建客户端
I see how to create them client side with the call to
[Client] Meteor.createUser(options, extra, callback)
但是假设我想在启动时创建一个Meteor用户集合记录?
But suppose I want to create a Meteor user collection record on startup?
例如,在启动/引导应用程序期间使用管理员帐户吗?
For example, the Administrator account during startup/bootstrapping for an application?
谢谢 史蒂夫
推荐答案
现在可能是众所周知的事实,但是为了完成此操作-在auth
分支上有一个新的服务器API可以执行此操作.从关于auth的文档:
Probably it's a well known fact now, but for the sake of completing this - there's a new server API for doing this on the auth
branch. From the docs on auth:
"[服务器] Meteor.createUser(选项,额外)-创建一个用户并 向该用户发送一封电子邮件,其中包含用于选择其初始密码的链接 并完成他们的帐户注册
" [Server] Meteor.createUser(options, extra) - Creates a user and sends that user an email with a link to choose their initial password and complete their account enrollment
选项包含以下内容的哈希:电子邮件(必填),用户名(可选) extra:用户对象的额外字段(例如名称等). "
options a hash containing: email (mandatory), username (optional) extra: extra fields for the user object (eg name, etc). "
请注意,该API可能会更改,因为它尚未在master分支上.
Please note the API is subject to change as it's not on the master branch yet.
这篇关于如何在Meteor中创建用户服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!