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
282 changed files with 14689 additions and 99 deletions
Showing only changes of commit 9ff0f51e19 - Show all commits

View File

@ -11,17 +11,20 @@ public class CreateUserRequest
/// Gets or sets the email address of the user.
/// </summary>
[Required]
[EmailAddress]
public required string Email { get; set; }
/// <summary>
/// Gets or sets the username of the user.
/// </summary>
[Required]
[MinLength(2)]
public required string Username { get; set; }
/// <summary>
/// Gets or sets the password of the user.
/// </summary>
[Required]
[MinLength(2)]
public required string Password { get; set; }
}

View File

@ -29,7 +29,6 @@ using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
@ -305,10 +304,6 @@ public class SetupController(
public ActionResult<string> CreateAdmin([FromBody] CreateUserRequest userRequest)
{
new PasswordPolicyService(GeneralConfig.PasswordPolicy).ValidatePasswordOrThrow(userRequest.Password);
if (!MailAddress.TryCreate(userRequest.Email, out _))
throw new ControllerArgumentException("The email address is incorrect.");
var (salt, hash) = passwordHashService.HashPassword(userRequest.Password);
var admin = new Admin