我正在尝试在创建用户的个人资料时添加accountActive和accountExpirationDate.根据我读过的所有内容,我应该使用Accounts.onCreateUser,如下所示:
// Add accountActive and accountExpirationDate
Accounts.onCreateUser(function(options, user) {
if (options.profile) {
user.profile = options.profile;
user.profile.accountActive = false;
user.profile.accountExpirationDate = null;
}
return user;
});
Run Code Online (Sandbox Code Playgroud)
这两个字段没有添加,我在Console中收到此错误.
Uncaught TypeError: Object #<Object> has no method 'onCreateUser'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
941 次 |
| 最近记录: |