Browse Source

Added specific error message for invalid username.

master
Teknikode 6 years ago
parent
commit
dd0e84e666
  1. 8
      Teknik/Areas/User/Controllers/UserController.cs

8
Teknik/Areas/User/Controllers/UserController.cs

@ -218,13 +218,17 @@ namespace Teknik.Areas.Users.Controllers @@ -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