From 740d5541e7f9fa99b5764113f52e729509984980 Mon Sep 17 00:00:00 2001 From: Harm Brugge Date: Fri, 20 Dec 2024 14:38:53 +0100 Subject: [PATCH] Change oidc variable in Database class when setting is changed (#4581) --- .../src/main/java/org/molgenis/emx2/sql/SqlDatabase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlDatabase.java b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlDatabase.java index 479840f5a2..182ed01aa5 100644 --- a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlDatabase.java +++ b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlDatabase.java @@ -435,9 +435,11 @@ public Database setSettings(Map settings) { } if (settings.containsKey(Constants.IS_OIDC_ENABLED)) { String isOidcEnabledSetting = settings.get(Constants.IS_OIDC_ENABLED); - if (Boolean.parseBoolean(isOidcEnabledSetting) && !isValidOidcSettings()) { + boolean isOidcEnabled = Boolean.parseBoolean(isOidcEnabledSetting); + if (isOidcEnabled && !isValidOidcSettings()) { throw new MolgenisException("OIDC environment setting are incomplete"); } + this.isOidcEnabled = isOidcEnabled; } super.setSettings(settings);