public TokenEntity Login([FromBody] LoginRequest loginRequest) { var token = _tokenService.AuthenticateUser(loginRequest.Username, loginRequest.Password); if (token == null) { throw new HttpResponseException(HttpStatusCode.Unauthorized); } return(token); }