private UserViewModel AuthenticateUser(LoginModel login) { UserModel user = _userContext.GetSingleUser(login.email, login.password); if (user != null) { var authUser = new UserViewModel { Id = user.Id, Email = user.Username, Name = user.Name, Image = user.Image }; return(authUser); } return(null); }