Browse Source

Added specific error message for invalid username.

tags/2.0.3
Teknikode 4 years ago
parent
commit
dd0e84e666
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      Teknik/Areas/User/Controllers/UserController.cs

+ 6
- 2
Teknik/Areas/User/Controllers/UserController.cs View File

@@ -218,13 +218,17 @@ namespace Teknik.Areas.Users.Controllers
{
if (Config.UserConfig.RegistrationEnabled)
{
if (!UserHelper.ValidUsername(Config, model.Username))
{
return Json(new { error = "That username is not valid" });
}
if (!UserHelper.UsernameAvailable(db, Config, model.Username))
{
return Json(new { error = "That username is not available." });
return Json(new { error = "That username is not available" });
}
if (model.Password != model.ConfirmPassword)
{
return Json(new { error = "Passwords must match." });
return Json(new { error = "Passwords must match" });
}

try

Loading…
Cancel
Save