簡體   English   中英

meteorjs Accounts.createUser不再工作了

[英]meteorjs Accounts.createUser not working anymore

Accounts.createUser方法不再起作用。 幾天前一切正常,我確信我沒有改變任何東西。

我有一張注冊表。 在提交時單擊以下代碼將執行:

編輯我忘了說這個函數是在流星方法中,所以它將在客戶端和服務器上執行

var newUserData = {
            username : post.email,
            password : post.pwd,
            email : post.email,
            profile: {
                first_name : post.first_name,
                last_name : post.last_name,
                register : ''
            }
        };
        console.log('### new user data ###');
        console.log(newUserData);
        var newUserCreated = Accounts.createUser(newUserData, function(e){
            console.log('### createuser callback ###');
            console.log(e);
        });
        console.log(newUserCreated);

“newUserData”返回一個有效的對象。 在我的例子中這個:

{ 
username: 'info@email.com',
password: 'mypassword',
email: 'info@email.com',
profile: 
{ first_name: 'wadwad',
last_name: 'wadawd',
register: '' } 
}

此控制台日志在客戶端和服務器端相同。

createuser回調只適用於客戶端並返回:

Error: No result from call to createUser

newUserCreated什么都不返回 - 不在客戶端而不在服務器端。

任何想法這個錯誤意味着什么? 無法在谷歌上找到參考。

編輯2如果知道它很重要:createUser方法到目前為止工作正常。 我在createUser所在的方法中沒有改變任何東西。 我已經使用此功能創建了用戶和Accounts-package,我可以使用這些帳戶登錄。

問題是來自createUser的回調。 我覺得這有點愚蠢。 回調只適用於客戶端而不是服務器端 - 但是當在服務器端執行帶回調的方法時,服務器崩潰並且不會添加任何用戶。

它有點奇怪,但有什么 - 刪除回調,一切都很好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM