From 6f9bfd3880f8ac57aad5625522628c5b60c3c52f Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sat, 7 Sep 2024 04:18:04 +0300 Subject: [PATCH] fix: set correct password condition --- Endpoint/Controllers/Configuration/SetupController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Endpoint/Controllers/Configuration/SetupController.cs b/Endpoint/Controllers/Configuration/SetupController.cs index 153af04..5b7b149 100644 --- a/Endpoint/Controllers/Configuration/SetupController.cs +++ b/Endpoint/Controllers/Configuration/SetupController.cs @@ -211,7 +211,7 @@ public class SetupController( [BadRequestResponse] public ActionResult CreateAdmin([FromBody] CreateUserRequest user) { - if (PasswordHashService.HasPasswordInPolicySecurity(user.Password)) + if (!PasswordHashService.HasPasswordInPolicySecurity(user.Password)) throw new ControllerArgumentException("The password must be at least 8 characters long and contain at least one uppercase letter and one special character."); if (!MailAddress.TryCreate(user.Email, out _))