From 294f00305d56075d1c0847ba252153db15f00382 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 20 Mar 2019 14:11:09 +0300 Subject: [PATCH] Checked if identityUser is null in CheckPassword method of AbpAccountWebModule --- .../Areas/Account/Controllers/AccountController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs index 3992e15f49..700d52b3a9 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs @@ -47,6 +47,12 @@ namespace Volo.Abp.Account.Web.Areas.Account.Controllers { ValidateLoginInfo(login); var identityUser = await _userManager.FindByNameAsync(login.UserNameOrEmailAddress); + + if (identityUser == null) + { + return new AbpLoginResult(LoginResultType.InvalidUserNameOrPassword); + } + return GetAbpLoginResult(await _signInManager.CheckPasswordSignInAsync(identityUser, login.Password, true)); }