{"action":"created","issue":{"url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/125","repository_url":"https://api.github.com/repos/holidayextras/jsonapi-server","labels_url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/125/comments","events_url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/125/events","html_url":"https://github.com/holidayextras/jsonapi-server/pull/125","id":154867718,"number":125,"title":"Respond with friendlier errors to unauthorised requests","user":{"login":"theninj4","id":3055120,"avatar_url":"https://avatars.githubusercontent.com/u/3055120?v=3","gravatar_id":"","url":"https://api.github.com/users/theninj4","html_url":"https://github.com/theninj4","followers_url":"https://api.github.com/users/theninj4/followers","following_url":"https://api.github.com/users/theninj4/following{/other_user}","gists_url":"https://api.github.com/users/theninj4/gists{/gist_id}","starred_url":"https://api.github.com/users/theninj4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theninj4/subscriptions","organizations_url":"https://api.github.com/users/theninj4/orgs","repos_url":"https://api.github.com/users/theninj4/repos","events_url":"https://api.github.com/users/theninj4/events{/privacy}","received_events_url":"https://api.github.com/users/theninj4/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/holidayextras/jsonapi-server/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-14T18:08:02Z","updated_at":"2016-05-14T22:21:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/holidayextras/jsonapi-server/pulls/125","html_url":"https://github.com/holidayextras/jsonapi-server/pull/125","diff_url":"https://github.com/holidayextras/jsonapi-server/pull/125.diff","patch_url":"https://github.com/holidayextras/jsonapi-server/pull/125.patch"},"body":"This resolves #113 - when a client makes a request that fails the authentication check, they'll now get a friendlier response:\r\n\r\n```\r\n{\r\n  jsonapi: {\r\n    version: \"1.0\"\r\n  },\r\n  meta: {\r\n    description: \"This block shows up in the root node of every payload\"\r\n  },\r\n  links: {\r\n    self: \"http://localhost:16006/rest/articles\"\r\n  },\r\n  errors: [\r\n    {\r\n      status: \"401\",\r\n      code: \"UNAUTHORIZED\",\r\n      title: \"Authentication Failed\",\r\n      detail: \"Nope\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nThe contents of the `detail` property come directly from the result of the authentication function, allowing developers to inject more detail about why authentication failed."},"comment":{"url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/comments/219254787","html_url":"https://github.com/holidayextras/jsonapi-server/pull/125#issuecomment-219254787","issue_url":"https://api.github.com/repos/holidayextras/jsonapi-server/issues/125","id":219254787,"user":{"login":"pmcnr-hx","id":10811943,"avatar_url":"https://avatars.githubusercontent.com/u/10811943?v=3","gravatar_id":"","url":"https://api.github.com/users/pmcnr-hx","html_url":"https://github.com/pmcnr-hx","followers_url":"https://api.github.com/users/pmcnr-hx/followers","following_url":"https://api.github.com/users/pmcnr-hx/following{/other_user}","gists_url":"https://api.github.com/users/pmcnr-hx/gists{/gist_id}","starred_url":"https://api.github.com/users/pmcnr-hx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmcnr-hx/subscriptions","organizations_url":"https://api.github.com/users/pmcnr-hx/orgs","repos_url":"https://api.github.com/users/pmcnr-hx/repos","events_url":"https://api.github.com/users/pmcnr-hx/events{/privacy}","received_events_url":"https://api.github.com/users/pmcnr-hx/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T22:21:10Z","updated_at":"2016-05-14T22:21:10Z","body":":+1: :shipit: "}}