Gez*_*zim 7 authentication accounts meteor
我有一个独特的用户创建流程如下:
那么,我如何通过Meteor Accounts和User模型实现这一目标?
简而言之:
onCreateUser以{anonymous:1}在使用随机密码时添加"匿名"字段(),可能是使用Meteor.uuid().{created:new Date()})以清除旧的匿名帐户.Meteor.autorun(function()
{Meteor.users.find({anonymous:1,$where:"new Date() - this.created >
360000"}).forEach(function (user) {
Meteor.users.remove({_id:user._id})}});$set:{anonymous:0}不要使用localStorage,也不要使用UID.会话cookie是您的UID.
我不知道如何帮助进行身份验证,但对于创建空白 User 对象,我已在服务器端成功完成了以下操作(使用不同的名称...):
Meteor.users.insert({profile: {name: 'Oompa Loompa'}, foo: 'bar'});