1

验证工作正常,但如果我更改帐户/注册

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);

这是一个已知的错误还是我错过了什么

4

1 回答 1

0

看起来在您对 SignInManger.PasswordSignInAsync 的调用中,您仍然在电子邮件中作为您希望用于身份验证的用户名而不是 UserName 属性发送。

 var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false);
于 2014-11-24T15:00:26.587 回答