mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 00:08:50 -07:00
fix null exception in LoginParent
This commit is contained in:
parent
bdd4111722
commit
17685e76d8
@ -48,8 +48,13 @@ public class AuthenticationController : Controller {
|
||||
} else {
|
||||
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
|
||||
}
|
||||
|
||||
if (user is null) {
|
||||
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidUserName });
|
||||
}
|
||||
|
||||
PasswordVerificationResult result = new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password);
|
||||
if (user is null || result == PasswordVerificationResult.Failed) {
|
||||
if (result == PasswordVerificationResult.Failed) {
|
||||
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword });
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user