1
0
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:
Patrik J. Braun 2023-03-11 23:00:57 +01:00
parent 67e5d6faaf
commit 2287893bf4

View File

@ -125,7 +125,8 @@ export class SQLConnection {
// Add dummy Admin to the db
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();
a.name = 'admin';
a.password = PasswordHelper.cryptPassword('admin');