public IActionResult Authenticate([FromBody] User userParam) { var user = _tokenService.Authenticate(userParam.Username, userParam.Password); if (user == null) { return(BadRequest(new { message = "Username or password is incorrect" })); } return(Ok(user)); }