我想使用AutoForm创建一个注册表单,其中后续创建用户。 Furtehremore,新用户注册后应自动登录。如何使用AutoForm注册用户并登录?
因此,我创建了一个自动窗体和提供的meteormethod
称为signUp
:
Meteor.methods({
signUp: function (doc) {
check(doc, Schema.signUp);
Accounts.createUser({username: doc.username, password: doc.password});
}
});
这完美的作品。但是,我不知道如何从服务器端登录用户?这甚至有可能吗?
如果不是,我该如何解决这个问题?我需要在我的Schema custom
验证功能中包含Accounts.createUser({username: doc.username, password: doc.password});
吗?
查看Atmosphere上的useraccounts包。这可能是你想要的,虽然不是这个问题的答案 –
也不要把'Accounts.createUser'放在'custom'验证函数中。你能解释一下你的方法没有登录你的问题吗?在服务器端登录某人意味着什么?哪个客户端登录? –