Release v1.0.0 #16

Merged
Wesser merged 492 commits from release/v1.0.0 into master 2025-02-12 09:19:32 +03:00
281 changed files with 14377 additions and 98 deletions
Showing only changes of commit 78254ed23d - Show all commits

View File

@ -302,19 +302,19 @@ public class SetupController(
[HttpPost("CreateAdmin")] [HttpPost("CreateAdmin")]
[TokenAuthentication] [TokenAuthentication]
[BadRequestResponse] [BadRequestResponse]
public ActionResult<string> CreateAdmin([FromBody] CreateUserRequest user) public ActionResult<string> 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."); 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 var admin = new Admin
{ {
Username = user.Username, Username = userRequest.Username,
Email = user.Email, Email = userRequest.Email,
PasswordHash = hash, PasswordHash = hash,
Salt = salt Salt = salt
}; };