简体   繁体   English

流星Accounts.createUser引发内部服务器错误?

[英]Meteor Accounts.createUser throws internal server error?

I have been using Meteor for two weeks, I am trying to add functionality to send an email once the user account has been created. 我已经使用Meteor两周了,我试图添加创建用户帐户后发送电子邮件的功能。 I have looked at several tutorials on the Accounts.onCreateUser() function. 我看了关于Accounts.onCreateUser()函数的一些教程。 Here is the code below. 这是下面的代码。

if(Meteor.isClient{
   ....some code here.....
   Accounts.createUser({
      ..... Insert some options ......
   }, function(error){
      ..... some More code here ......
   });
}

if(Meteor.isServer){
   Accounts.onCreate(function(options, user){
      ...... Do the required .......
   });
}

It seems like it is according to the several tutorials that I have been using. 看来这是根据我一直在使用的几本教程得出的。

I have tested out the code and but the onCreate for the account is always returning 'Internal server error' and I can't find out a cause for it. 我已经测试了代码,但是该帐户的onCreate总是返回“内部服务器错误”,而我找不到原因。 Is this the way that I am supposed the Accounts.onCreate() callback for the form? 这是我被认为是表单的Accounts.onCreate()回调的方式吗?

Also is there a debugging functionality if so I can further track the code down? 如果我可以进一步跟踪代码,是否还有调试功能?

Thanks 谢谢

Your code says onCreate instead of onCreateUser . 您的代码说的是onCreate而不是onCreateUser Maybe that's a typo? 也许是错字? Also make sure it is returning a user document. 还要确保它正在返回user文档。 You can always add a console.log to test if the function is being called with the right parameters. 您始终可以添加console.log来测试是否使用正确的参数调用了该函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM