diff --git a/src/Unosquare.PassCore.PasswordProvider/PasswordChangeProvider.cs b/src/Unosquare.PassCore.PasswordProvider/PasswordChangeProvider.cs index a16564c2..cf49394e 100644 --- a/src/Unosquare.PassCore.PasswordProvider/PasswordChangeProvider.cs +++ b/src/Unosquare.PassCore.PasswordProvider/PasswordChangeProvider.cs @@ -179,7 +179,7 @@ private string FixUsernameWithDomain(string username) "The User principal is listed as restricted"); } - return groups?.Any(x => _options.AllowedADGroups?.Contains(x.Name) == true) == true + return groups?.Any(x => _options.AllowedADGroups?.Contains(x.Name) != false) == true ? null : new ApiErrorItem(ApiErrorCode.ChangeNotPermitted, "The User principal is not listed as allowed"); } diff --git a/src/Unosquare.PassCore.Web/Controllers/PasswordController.cs b/src/Unosquare.PassCore.Web/Controllers/PasswordController.cs index 91dd1e47..4413e7c4 100644 --- a/src/Unosquare.PassCore.Web/Controllers/PasswordController.cs +++ b/src/Unosquare.PassCore.Web/Controllers/PasswordController.cs @@ -142,7 +142,7 @@ private async Task ValidateRecaptcha(string? recaptchaResponse) // skip validation if we don't enable recaptcha if ((_options.Recaptcha != null) && string.IsNullOrWhiteSpace(_options.Recaptcha.PrivateKey)) return true; - else if ((_options.Recaptcha != null) && (string.IsNullOrEmpty(recaptchaResponse) != false)) + else if ((_options.Recaptcha != null) && (string.IsNullOrEmpty(recaptchaResponse) != true)) { var requestUrl = new Uri( $"https://www.google.com/recaptcha/api/siteverify?secret={_options.Recaptcha.PrivateKey}&response={recaptchaResponse}");