调用'createUser'的传递结果异常



所以我有麻烦调用标准流星帐户。createUser函数。我正在尝试使用流星帐户基础和帐户密码包实现帐户系统。该项目基于Meteor 1.3和React。

当我调用Accounts.createUser(userObject)时,我得到"异常在提供调用'createUser'的结果"背后有一些神秘的混乱。

我代码:

onSignUp(e) {
e.preventDefault();
let email = $(e.target).find("[name=email]").val(),
    password = $(e.target).find("[name=password]").val(),
    confirmPassword = $(e.target).find("[name=confirmPassword]").val();
if (password == confirmPassword) {
  Accounts.createUser({
    mail: email,
    password: password
  }, function(error){
    if (error) {
      Bert.alert( err.reason, 'danger', 'growl-top-right' );
    } else {
      Bert.alert( "Welcome!", 'success', 'growl-top-right');
      console.log(userObject);
      FlowRouter.go('/');
    }
  });

这是目前在我的客户端文件夹,但我试图移动createAccount调用到服务器端方法,但它给了我同样的错误。

我试着在调试模式下运行流星,但我很难理解发生了什么。从我所能理解的,而登录有要么没有结果或登录无法验证。

Replace

Accounts.createUser({
    mail: email,
    password: password
  }

Accounts.createUser({
        email: email,      //email
        password: password,
        profile :'default-group',
      }

同时,将帐户创建代码移到服务器端。

参考:Meteor Docs

最新更新