From 9c46344e681af282b6484d4db731eb380a1253cb Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Wed, 12 Feb 2025 21:20:32 +0800 Subject: [PATCH] feat: improve default org passwordOptions handling --- object/check_password_complexity.go | 2 +- web/src/OrganizationListPage.js | 2 +- web/src/common/PasswordChecker.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/object/check_password_complexity.go b/object/check_password_complexity.go index 6e7829c4..87c86bec 100644 --- a/object/check_password_complexity.go +++ b/object/check_password_complexity.go @@ -74,7 +74,7 @@ func checkPasswordComplexity(password string, options []string) string { } if len(options) == 0 { - options = []string{"AtLeast6"} + return "" } checkers := map[string]ValidatorFunc{ diff --git a/web/src/OrganizationListPage.js b/web/src/OrganizationListPage.js index 1138b8df..9b683870 100644 --- a/web/src/OrganizationListPage.js +++ b/web/src/OrganizationListPage.js @@ -34,7 +34,7 @@ class OrganizationListPage extends BaseListPage { favicon: `${Setting.StaticBaseUrl}/img/favicon.png`, passwordType: "plain", PasswordSalt: "", - passwordOptions: [], + passwordOptions: ["AtLeast6"], passwordObfuscatorType: "Plain", passwordObfuscatorKey: "", passwordExpireDays: 0, diff --git a/web/src/common/PasswordChecker.js b/web/src/common/PasswordChecker.js index 72b46c38..b458a04a 100644 --- a/web/src/common/PasswordChecker.js +++ b/web/src/common/PasswordChecker.js @@ -58,7 +58,7 @@ export function checkPasswordComplexity(password, options) { } if (!options || options.length === 0) { - options = ["AtLeast6"]; + return ""; } const checkers = {