Commit 6a29af7a4a29b1a9f396518e3764b5a5fff25c97
Exists in
master
Merge branch 'MichelFloyd-master'
Closes #208
Showing
2 changed files
Show diff stats
imports/startup/server/browser-policy.js
imports/startup/server/fixtures.js
... | ... | @@ -2,20 +2,22 @@ import { Meteor } from 'meteor/meteor'; |
2 | 2 | import { Roles } from 'meteor/alanning:roles'; |
3 | 3 | import { Accounts } from 'meteor/accounts-base'; |
4 | 4 | |
5 | -const users = [{ | |
6 | - email: 'admin@admin.com', | |
7 | - password: 'password', | |
8 | - profile: { | |
9 | - name: { first: 'Carl', last: 'Winslow' }, | |
10 | - }, | |
11 | - roles: ['admin'], | |
12 | -}]; | |
5 | +if (!Meteor.isProduction) { | |
6 | + const users = [{ | |
7 | + email: 'admin@admin.com', | |
8 | + password: 'password', | |
9 | + profile: { | |
10 | + name: { first: 'Carl', last: 'Winslow' }, | |
11 | + }, | |
12 | + roles: ['admin'], | |
13 | + }]; | |
13 | 14 | |
14 | -users.forEach(({ email, password, profile, roles }) => { | |
15 | - const userExists = Meteor.users.findOne({ 'emails.address': email }); | |
15 | + users.forEach(({ email, password, profile, roles }) => { | |
16 | + const userExists = Meteor.users.findOne({ 'emails.address': email }); | |
16 | 17 | |
17 | - if (!userExists) { | |
18 | - const userId = Accounts.createUser({ email, password, profile }); | |
19 | - Roles.addUsersToRoles(userId, roles); | |
20 | - } | |
21 | -}); | |
18 | + if (!userExists) { | |
19 | + const userId = Accounts.createUser({ email, password, profile }); | |
20 | + Roles.addUsersToRoles(userId, roles); | |
21 | + } | |
22 | + }); | |
23 | +} | ... | ... |