public UserLoginStatus ValidateUser(string userName, string password)
{
var user =
_userRepository.Table
.FirstOrDefault(
n => n.UserName == userName || n.AccountEmail == userName || n.AccountMobile == userName);
if (user == null)
return UserLoginStatus.IsNotExist;
if (!UserPasswordHelper.CheckPassword(password, user.Password, user.PasswordFormat))
return UserLoginStatus.InvalidCredentials;
return !user.IsActived ? UserLoginStatus.NotActivated : UserLoginStatus.Success;
}