[AZ-199] [AZ-200] [AZ-201] [AZ-202] Fix API bugs

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-16 06:55:11 +03:00
parent 5286b6b8e3
commit 88c7b288df
9 changed files with 71 additions and 38 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ public enum ExceptionEnum
[Description("Passwords do not match.")]
WrongPassword = 30,
[Description("Password should be at least 8 characters.")]
[Description("Password should be at least 12 characters.")]
PasswordLengthIncorrect = 32,
[Description("Email is empty or invalid.")]
+4 -1
View File
@@ -1,9 +1,12 @@
namespace Azaion.Common.Entities;
using System.Text.Json.Serialization;
namespace Azaion.Common.Entities;
public class User
{
public Guid Id { get; set; }
public string Email { get; set; } = null!;
[JsonIgnore]
public string PasswordHash { get; set; } = null!;
public string? Hardware { get; set; }
public RoleEnum Role { get; set; }
@@ -19,5 +19,5 @@ public class RegisterUserValidator : AbstractValidator<RegisterUserRequest>
.EmailAddress().WithErrorCode(ExceptionEnum.WrongEmail.ToString()).WithMessage("Email address is not valid.");
RuleFor(r => r.Password)
.MinimumLength(8).WithErrorCode(ExceptionEnum.PasswordLengthIncorrect.ToString()).WithMessage("Password should be at least 8 characters.");
.MinimumLength(12).WithErrorCode(ExceptionEnum.PasswordLengthIncorrect.ToString()).WithMessage("Password should be at least 12 characters.");
} }