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

Do not add users if authentication is not required

This commit is contained in:
Patrik J. Braun 2022-02-26 12:45:26 +01:00
parent 6cc171c7f5
commit 950067c789

View File

@ -96,6 +96,9 @@ export class SQLConnection {
public static async init(): Promise<void> { public static async init(): Promise<void> {
const connection = await this.getConnection(); const connection = await this.getConnection();
if (Config.Client.authenticationRequired !== true) {
return;
}
// Adding enforced users to the db // Adding enforced users to the db
const userRepository = connection.getRepository(UserEntity); const userRepository = connection.getRepository(UserEntity);
if (Array.isArray(Config.Server.Database.enforcedUsers) && if (Array.isArray(Config.Server.Database.enforcedUsers) &&