diff --git a/src/Infrastructure/Services/Identity/CustomSigninManager.cs b/src/Infrastructure/Services/Identity/CustomSigninManager.cs index 2c32d758..1456a311 100644 --- a/src/Infrastructure/Services/Identity/CustomSigninManager.cs +++ b/src/Infrastructure/Services/Identity/CustomSigninManager.cs @@ -20,6 +20,11 @@ public override async Task PasswordSignInAsync(string userName, st var passwordCheckResult = await CheckPasswordSignInAsync(user, password, lockoutOnFailure); + if(passwordCheckResult.Succeeded is false) + { + return passwordCheckResult; + } + if (PasswordChecksOutAndRequiresPasswordReset(passwordCheckResult, user)) { return CustomSignInResult.PasswordResetRequired; diff --git a/src/Server.UI/Pages/Identity/Users/Users.razor b/src/Server.UI/Pages/Identity/Users/Users.razor index edc0d51a..710ccabb 100644 --- a/src/Server.UI/Pages/Identity/Users/Users.razor +++ b/src/Server.UI/Pages/Identity/Users/Users.razor @@ -411,9 +411,9 @@ _initialised = true; } - private bool CanResetPassword(string[] roles) + private bool CanResetPassword(string[] affectedUserRoles) { - var userRole = _roles.Where(role => roles.Contains(role.Name)).MinBy(role => role.RoleRank); + var userRole = _roles.Where(role => affectedUserRoles.Contains(role.Name)).MinBy(role => role.RoleRank); var currentUserRole = _roles.Where(role => CurrentRoles.Contains(role.Name)).MinBy(role => role.RoleRank); return _canResetPassword && currentUserRole?.RoleRank <= userRole?.RoleRank; }