diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index 465680a..96e1065 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -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().VerifyHashedPassword(null, user.Password, data.Password); - if (user is null || result == PasswordVerificationResult.Failed) { + if (result == PasswordVerificationResult.Failed) { return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword }); }