From 78254ed23d8b47b8c40142527f5173184a679f0d Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Mon, 23 Dec 2024 06:28:28 +0300 Subject: [PATCH] fix: change same name --- .../Controllers/Configuration/SetupController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Endpoint/Controllers/Configuration/SetupController.cs b/Endpoint/Controllers/Configuration/SetupController.cs index ab17c64..2ea17e2 100644 --- a/Endpoint/Controllers/Configuration/SetupController.cs +++ b/Endpoint/Controllers/Configuration/SetupController.cs @@ -302,19 +302,19 @@ public class SetupController( [HttpPost("CreateAdmin")] [TokenAuthentication] [BadRequestResponse] - public ActionResult CreateAdmin([FromBody] CreateUserRequest user) + public ActionResult CreateAdmin([FromBody] CreateUserRequest userRequest) { - new PasswordPolicyService(GeneralConfig.PasswordPolicy).ValidatePasswordOrThrow(user.Password); + new PasswordPolicyService(GeneralConfig.PasswordPolicy).ValidatePasswordOrThrow(userRequest.Password); - if (!MailAddress.TryCreate(user.Email, out _)) + if (!MailAddress.TryCreate(userRequest.Email, out _)) throw new ControllerArgumentException("The email address is incorrect."); - var (salt, hash) = passwordHashService.HashPassword(user.Password); + var (salt, hash) = passwordHashService.HashPassword(userRequest.Password); var admin = new Admin { - Username = user.Username, - Email = user.Email, + Username = userRequest.Username, + Email = userRequest.Email, PasswordHash = hash, Salt = salt };