验证工作正常,但如果我更改帐户/注册
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
到
var user = new ApplicationUser { UserName = model.UserName, Email = model.Email };
验证始终未通过帐户/登录
var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
这是一个已知的错误还是我错过了什么
答案 0 :(得分:0)
在您对SignInManger.PasswordSignInAsync的调用中,您仍然在发送电子邮件中作为您要用于验证的用户名而不是UserName属性。
var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false);