mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Also querying devs when creating def. admin user
This commit is contained in:
parent
67e5d6faaf
commit
2287893bf4
@ -125,7 +125,8 @@ export class SQLConnection {
|
|||||||
|
|
||||||
// Add dummy Admin to the db
|
// Add dummy Admin to the db
|
||||||
const admins = await userRepository.findBy({role: UserRoles.Admin});
|
const admins = await userRepository.findBy({role: UserRoles.Admin});
|
||||||
if (admins.length === 0) {
|
const devs = await userRepository.findBy({role: UserRoles.Developer});
|
||||||
|
if (admins.length === 0 && devs.length === 0) {
|
||||||
const a = new UserEntity();
|
const a = new UserEntity();
|
||||||
a.name = 'admin';
|
a.name = 'admin';
|
||||||
a.password = PasswordHelper.cryptPassword('admin');
|
a.password = PasswordHelper.cryptPassword('admin');
|
||||||
|
Loading…
Reference in New Issue
Block a user