Blame view

imports/startup/server/fixtures.js 398 Bytes
2b1ad7917   tmcdeveloper   wip moving to Met...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  const users = [{
    email: 'admin@admin.com',
    password: 'password',
    profile: {
      name: { first: 'Carl', last: 'Winslow' }
    }
  }];
  
  users.forEach( ( { email, password, profile } ) => {
    const userExists = Meteor.users.findOne( { 'emails.address': email } );
  
    if ( !userExists ) {
      Accounts.createUser({
        email: email,
        password: password,
        profile: profile
      });
    }
  });