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:
parent
a73208d2f8
commit
dd0e84e666
@ -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…
Reference in New Issue
Block a user