Deployment app. It does not work the default user


#1

It does not work the default user that is created in the “Meteor.startup”.

Is there a possibility to create a default user in meteor to work after deployment.


#2

Could you provide a sample code of how you’re implementing this “Create a default user in Meteor.startup()”?

Under normal circumstances, Meteor.startup() would execute and your user would be created and thus available for use in your app.


#3
Meteor.startup(function() {
  var myId;
  if (Meteor.users.find().count() === 0) {
    myId = Accounts.createUser({
      email: "a@a.com",
      password: "passwordtest",
      username: "testadmin",
      profile: {
        name: "Admin Test",
        gender: "male",
        profilePictureUrl: ""
      }
    });
    return Roles.addUsersToRoles(myId, 'Admin');
  }
});

#4

My mistake. I did not check the database MongoDB and there was already a user;)