Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually insert users from seed file with accounts-password

Tags:

meteor

Is there a way to seed users into accounts-password? Something like:

  Users.insert
    email: '[email protected]'
    password: 'secret'

I've tried many things but no luck yet. Thanks in advance for the help

like image 660
sturoid Avatar asked Dec 05 '25 12:12

sturoid


1 Answers

It's easiest to do this on the server when it starts:

Meteor.startup(function() {
  if (Meteor.users.find().count() === 0) {
    Accounts.createUser({
      username: 'test',
      email: '[email protected]',
      password: 'password'
    });
  }
});
like image 86
David Weldon Avatar answered Dec 07 '25 14:12

David Weldon