Disable automatic creation of profile field for accounts


#1

I’d like to disable the automatic creation of the profile field for my user accounts. How can I achieve this?


#2

The basic profile object is added by the accounts family of packages and can’t (currently) be disabled.

What is your requirement: could you just choose to not publish profile if you don’t want it visible on the client?


#3

Probably want to use the Accounts.onCreateUser((opt, usr) => {}) function. Load it on the server. https://docs.meteor.com/api/accounts-multi.html#AccountsServer-onCreateUser


#4

Cunning! I like that solution. :slight_smile:


#5

@energistic is right.

And you just need comment the part below:

Accounts.onCreateUser((options, user) => {
  // if (options.profile) {
  //   user.profile = options.profile;
  // }

  return user;
});

#6

@robfallows @energistic @Hongbo_Miao thanks for the replies!

Hm. Even after implementing your solutions my schema keeps throwing errors at me as if profile is still present, which is totally odd.

Edit: it’s a problem with simple-schema, not Meteor directly. Thanks again!