Merge pull request #384 from gOOvER/name-lengh

Updated all user name length attributes in form models
This commit is contained in:
Masu Baumgartner 2024-04-13 00:39:17 +02:00 committed by GitHub
commit 5a1ecebbe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }