Skip to content

Commit

Permalink
fix bug 66845
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Mar 13, 2024
1 parent dab874a commit 3bb1577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions products/ASC.People/Server/Api/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ public async Task<EmployeeFullDto> ChangeUserPassword(Guid userid, MemberRequest

if (!string.IsNullOrEmpty(inDto.Password))
{
await userManagerWrapper.CheckPasswordPolicyAsync(inDto.Password);
inDto.PasswordHash = passwordHasher.GetClientPassword(inDto.Password);
}
}
Expand Down
5 changes: 3 additions & 2 deletions web/ASC.Web.Core/Users/UserManagerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> TestUniqueUserNameAsync(string uniqueName)
{
Expand Down Expand Up @@ -318,7 +319,7 @@ public async Task CheckPasswordPolicyAsync(string password)

var passwordSettingsObj = await settingsManager.LoadAsync<PasswordSettings>();

if (!CheckPasswordRegex(passwordSettingsObj, password))
if (!CheckPasswordRegex(passwordSettingsObj, password) || !PasswordSettings.CheckLengthInRange(configuration, password.Length))
{
throw new Exception(GetPasswordHelpMessage(passwordSettingsObj));
}
Expand Down

0 comments on commit 3bb1577

Please sign in to comment.