Skip to content

Commit 16305a3

Browse files
committed
add users in mongo init
1 parent b054d11 commit 16305a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

addons/init-mongo.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ function seed(dbName, user, password) {
2525
{ code: 'EDITOR', status: true, createdAt: new Date(), updatedAt: new Date() },
2626
{ code: 'ADMIN', status: true, createdAt: new Date(), updatedAt: new Date() },
2727
]);
28+
29+
db.users.insert({
30+
name: 'Admin',
31+
32+
password: '$2a$10$psWmSrmtyZYvtIt/FuJL1OLqsK3iR1fZz5.wUYFuSNkkt.EOX9mLa' // hash of password: changeit
33+
});
2834
}
2935

3036
seed('blogs-db', 'blogs-db-user', 'changeit');

0 commit comments

Comments
 (0)