lot more placews for the Username lengh

This commit is contained in:
gOOvER
2024-04-12 15:13:49 +02:00
parent e5f4fd9d62
commit 8dbf458ea3
4 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms;
public class RegisterForm public class RegisterForm
{ {
[Required(ErrorMessage = "You need to provide an username")] [Required(ErrorMessage = "You need to provide an username")]
[MinLength(7, ErrorMessage = "The username is too short")] [MinLength(6, ErrorMessage = "The username is too short")]
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")] [MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
[RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")] [RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")]
public string Username { get; set; } public string Username { get; set; }

View File

@@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms;
public class UpdateAccountForm public class UpdateAccountForm
{ {
[Required(ErrorMessage = "You need to provide an username")] [Required(ErrorMessage = "You need to provide an username")]
[MinLength(7, ErrorMessage = "The username is too short")] [MinLength(6, ErrorMessage = "The username is too short")]
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")] [MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
public string Username { get; set; } public string Username { get; set; }

View File

@@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms.Users;
public class CreateUserForm public class CreateUserForm
{ {
[Required(ErrorMessage = "You need to provide an username")] [Required(ErrorMessage = "You need to provide an username")]
[MinLength(7, ErrorMessage = "The username is too short")] [MinLength(6, ErrorMessage = "The username is too short")]
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")] [MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
[RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")] [RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")]
public string Username { get; set; } public string Username { get; set; }

View File

@@ -6,7 +6,7 @@ namespace Moonlight.Core.Models.Forms.Users;
public class UpdateUserForm public class UpdateUserForm
{ {
[Required(ErrorMessage = "You need to provide an username")] [Required(ErrorMessage = "You need to provide an username")]
[MinLength(7, ErrorMessage = "The username is too short")] [MinLength(6, ErrorMessage = "The username is too short")]
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")] [MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
[RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")] [RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")]
public string Username { get; set; } public string Username { get; set; }