1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02: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');