修改BUG:MongoDB数据库登录用户名区分大小写
This commit is contained in:
parent
8a6385b5a4
commit
4201568f2b
|
@ -47,7 +47,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(password)) return false;
|
if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(password)) return false;
|
||||||
|
|
||||||
var u = DbManager.Users.Find(user => user.UserName == userName).FirstOrDefault();
|
var u = DbManager.Users.Find(user => user.UserName.Equals(userName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||||
return !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt);
|
return !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue