I want my password field to accept empty string. I am using database first approach and I have changed the definition of AspNetUsers table to allow Null for PasswordHash. But during Register It says password must be 6 characters. How can I remove this validation. My project does not contain IdentityConfig.cs class. I have recently updated Identity to 2.2.1. I am using MVC.
Update
I have written this function in AccountController.
[HttpPost]
[AllowAnonymous]
public async Task<JsonResult> RegisterUser(string email, string password = "")
{
var user = new ApplicationUser() { UserName = email };
var result = await UserManager.CreateAsync(user, password);
if (result.Succeeded)
{
await SignInAsync(user, isPersistent: true);
return Json("Done", JsonRequestBehavior.AllowGet);
}
return Json("Error", JsonRequestBehavior.AllowGet);
}
I get validation error in result variable.
AccountViewModelclass in Models folder?