diff --git a/products/ASC.People/Server/Api/UserController.cs b/products/ASC.People/Server/Api/UserController.cs index e99cd52288a..b0eaf923eb8 100644 --- a/products/ASC.People/Server/Api/UserController.cs +++ b/products/ASC.People/Server/Api/UserController.cs @@ -372,6 +372,7 @@ public async Task ChangeUserPassword(Guid userid, MemberRequest if (!string.IsNullOrEmpty(inDto.Password)) { + await userManagerWrapper.CheckPasswordPolicyAsync(inDto.Password); inDto.PasswordHash = passwordHasher.GetClientPassword(inDto.Password); } } diff --git a/web/ASC.Web.Core/Users/UserManagerWrapper.cs b/web/ASC.Web.Core/Users/UserManagerWrapper.cs index 77af60a7211..b3ac4afe762 100644 --- a/web/ASC.Web.Core/Users/UserManagerWrapper.cs +++ b/web/ASC.Web.Core/Users/UserManagerWrapper.cs @@ -45,7 +45,8 @@ public sealed class UserManagerWrapper(StudioNotifyService studioNotifyService, WebItemSecurityCache webItemSecurityCache, QuotaSocketManager quotaSocketManager, TenantQuotaFeatureStatHelper tenantQuotaFeatureStatHelper, - IDistributedLockProvider distributedLockProvider) + IDistributedLockProvider distributedLockProvider, + IConfiguration configuration) { private async Task TestUniqueUserNameAsync(string uniqueName) { @@ -318,7 +319,7 @@ public async Task CheckPasswordPolicyAsync(string password) var passwordSettingsObj = await settingsManager.LoadAsync(); - if (!CheckPasswordRegex(passwordSettingsObj, password)) + if (!CheckPasswordRegex(passwordSettingsObj, password) || !PasswordSettings.CheckLengthInRange(configuration, password.Length)) { throw new Exception(GetPasswordHelpMessage(passwordSettingsObj)); }