From 950067c7893de31b5a6f2cd9a03ae5a4af658443 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sat, 26 Feb 2022 12:45:26 +0100 Subject: [PATCH] Do not add users if authentication is not required --- src/backend/model/database/sql/SQLConnection.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/model/database/sql/SQLConnection.ts b/src/backend/model/database/sql/SQLConnection.ts index 795385b0..69b86a02 100644 --- a/src/backend/model/database/sql/SQLConnection.ts +++ b/src/backend/model/database/sql/SQLConnection.ts @@ -96,6 +96,9 @@ export class SQLConnection { public static async init(): Promise { const connection = await this.getConnection(); + if (Config.Client.authenticationRequired !== true) { + return; + } // Adding enforced users to the db const userRepository = connection.getRepository(UserEntity); if (Array.isArray(Config.Server.Database.enforcedUsers) &&