How can I set email in onCreateUser function?

Now I working with social login and can’t set email address.

Accounts.onCreateUser(function(options, user) {
user.email = [
    	'test@mail.com'
]; // doesn't work
user.email = 'test@mail.com'; // doesn't work too
return user;
});

After login I get only this when calling Meteor.user() in my console:
{_id: “YH7uRvtboAv2oPWcc”, profile: {…}, username: “test”}

 user.emails = [
      {
            "address" : 'test@mail.com', 
            "verified" : true
      }
];
2 Likes