1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Adding error warning for using the default admin/admin user/password pair

This commit is contained in:
Patrik J. Braun 2021-12-31 14:38:01 +01:00
parent 956c81b075
commit 38dfcf03cd

View File

@ -21,6 +21,7 @@ import * as path from 'path';
import {DatabaseType, ServerDataBaseConfig, SQLLogLevel} from '../../../../common/config/private/PrivateConfig';
import {AlbumBaseEntity} from './enitites/album/AlbumBaseEntity';
import {SavedSearchEntity} from './enitites/album/SavedSearchEntity';
import {NotificationManager} from '../../NotifocationManager';
const LOG_TAG = '[SQLConnection]';
@ -105,6 +106,12 @@ export class SQLConnection {
a.role = UserRoles.Admin;
await userRepository.save(a);
}
const defAdmins = await userRepository.find({name: 'admin', role: UserRoles.Admin});
for (const a of defAdmins) {
if (PasswordHelper.comparePassword('admin', a.password)) {
NotificationManager.error('Using default admin user!', 'You are using the default admin/admin user/password, please change or remove it.');
}
}
}