mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 07:06:34 +00:00
[AZ-199] [AZ-200] [AZ-201] [AZ-202] Fix API bugs
Made-with: Cursor
This commit is contained in:
@@ -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.")]
|
||||
|
||||
@@ -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.");
|
||||
} }
|
||||
Reference in New Issue
Block a user