public IActionResult Login([FromBody] LoginModel loginValue) { LoginModel login = new LoginModel(); login.Name = loginValue.Name; login.Password = loginValue.Password; IActionResult response = Unauthorized(); var user = _helper.AuthenticateUser(login); if (user != null) { var tokenStr = _helper.GenerateJSONWebToken(user); response = Ok(new { token = tokenStr }); } return(response); }