From 55a7d71c7f39891f8b4c28a67d6d1b43b5f367bc Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Mon, 8 Jan 2024 08:43:11 +0100 Subject: [PATCH] Improved error message for username regex on register form --- Moonlight/App/Models/Forms/Auth/RegisterForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moonlight/App/Models/Forms/Auth/RegisterForm.cs b/Moonlight/App/Models/Forms/Auth/RegisterForm.cs index 6ed3dc2a..b07fed66 100644 --- a/Moonlight/App/Models/Forms/Auth/RegisterForm.cs +++ b/Moonlight/App/Models/Forms/Auth/RegisterForm.cs @@ -7,7 +7,7 @@ public class RegisterForm [Required(ErrorMessage = "You need to provide an username")] [MinLength(7, 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")] + [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; } [Required(ErrorMessage = "You need to provide an email address")]