Skip to content

Commit

Permalink
fix: updated json
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Dec 20, 2023
1 parent ac1a6a3 commit 8a9f858
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ public JsonObject toJson(boolean shouldProtectDbConfig, Storage storage, String[
tenantConfigObject.add("thirdParty", this.thirdPartyConfig.toJson());
tenantConfigObject.addProperty("tenantId", this.tenantIdentifier.getTenantId());

if (tenantConfigObject.has("firstFactors") && tenantConfigObject.get("firstFactors").getAsJsonArray().size() == 0) {
tenantConfigObject.remove("firstFactors");
}

if (tenantConfigObject.has("requiredSecondaryFactors") && tenantConfigObject.get("requiredSecondaryFactors").getAsJsonArray().size() == 0) {
tenantConfigObject.remove("requiredSecondaryFactors");
}

if (shouldProtectDbConfig) {
String[] protectedConfigs = storage.getProtectedConfigsFromSuperTokensSaaSUsers();
for (String config : protectedConfigs) {
Expand Down

0 comments on commit 8a9f858

Please sign in to comment.