public IActionResult Login(LoginViewModel loginViewModel) { var user = UserRepository.Get(loginViewModel.UserName, loginViewModel.Password); if (user == null) { return(BadRequest("Not Found")); } var token = TokenServices.GeneratorToken(user); user.Password = ""; return(new OkObjectResult(new { user, token })); }