From 8dbf458ea3272953270f98de0cf1a3e6ecfe7b87 Mon Sep 17 00:00:00 2001 From: gOOvER Date: Fri, 12 Apr 2024 15:13:49 +0200 Subject: [PATCH] lot more placews for the Username lengh --- Moonlight/Core/Models/Forms/RegisterForm.cs | 2 +- Moonlight/Core/Models/Forms/UpdateAccountForm.cs | 2 +- Moonlight/Core/Models/Forms/Users/CreateUserForm.cs | 2 +- Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Moonlight/Core/Models/Forms/RegisterForm.cs b/Moonlight/Core/Models/Forms/RegisterForm.cs index b5184b1..0348070 100644 --- a/Moonlight/Core/Models/Forms/RegisterForm.cs +++ b/Moonlight/Core/Models/Forms/RegisterForm.cs @@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms; public class RegisterForm { [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")] [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; } diff --git a/Moonlight/Core/Models/Forms/UpdateAccountForm.cs b/Moonlight/Core/Models/Forms/UpdateAccountForm.cs index d0070e9..f5fdafc 100644 --- a/Moonlight/Core/Models/Forms/UpdateAccountForm.cs +++ b/Moonlight/Core/Models/Forms/UpdateAccountForm.cs @@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms; public class UpdateAccountForm { [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")] public string Username { get; set; } diff --git a/Moonlight/Core/Models/Forms/Users/CreateUserForm.cs b/Moonlight/Core/Models/Forms/Users/CreateUserForm.cs index 45b3024..3d72e52 100644 --- a/Moonlight/Core/Models/Forms/Users/CreateUserForm.cs +++ b/Moonlight/Core/Models/Forms/Users/CreateUserForm.cs @@ -5,7 +5,7 @@ namespace Moonlight.Core.Models.Forms.Users; public class CreateUserForm { [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")] [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; } diff --git a/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs b/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs index 723deff..67da5d8 100644 --- a/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs +++ b/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs @@ -6,7 +6,7 @@ namespace Moonlight.Core.Models.Forms.Users; public class UpdateUserForm { [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")] [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; }