Search code examples
meteoraccountscreateuser

Accounts.createUser doesn't save profile


I have the following piece of code in my server/fixtures.js file:

var userId = Accounts.createUser({
  username: "tester",
  email: "[email protected]",
  password: "foobar",
  profile: { name: "Max" }
});
var user = Meteor.users.findOne({_id: userId});
console.log(user.profile.name);

Now when I run meteor it logs undefined. What am I doing wrong?


Solution

  • I'm pretty sure I've had an Accounts.onCreateUser callback defined somewhere that was responsible for this. My bad!