尝试创建和身份验证匿名做:
Meteor.startup(function () {
// Allocate a new user id.
if (!Meteor.userId()) {
var pass = Random.create().id();
var email = pass+'@example.com';
Accounts.createUser({password: pass, email: email}, function(err){
Meteor.loginWithPassword({password: pass, email: email});
});
} else {
}
});
这几乎工作得很好。但有时流星会同时创建两个用户。:(