1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added specific error message for invalid username.

This commit is contained in:
Uncled1023 2016-05-18 22:30:22 -07:00
parent a73208d2f8
commit dd0e84e666

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