{"action":"created","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/392","repository_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/392/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/392/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/392/events","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/392","id":154258820,"number":392,"title":"bug(session): ensure session is properly destroyed","user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels/bug%20fix","name":"bug fix","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-11T14:33:11Z","updated_at":"2016-05-11T15:24:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/392","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/392","diff_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/392.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/392.patch"},"body":"This PR hooks up a listener to the HTTP `401 unauthorized` status code that immediately destroys the user's session.  If necessary, we can embed a logout directive in the HTTP response if this is too non-specific. \r\n\r\nIt also namespaces the session events to prevent future conflicts.\r\n\r\nFixes the bug that kills the client when the server is restarted and the user still has their client session.\r\n\r\n---\r\nThank you for contributing!\r\n\r\nBefore submitting this pull request, please verify that you have:\r\n - [x] Run your code through JSHint.  [Check out our styleguide](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/docs/STYLEGUIDE.md).\r\n - [x] Run integration tests.\r\n - [x] Run end-to-end tests.\r\n - [x] Accurately described the changes your are making in this pull request.\r\n\r\nFor a more detailed checklist, [see the official review checklist](https://docs.google.com/document/d/1nupLVLRXgSZJQo_acLgrwvPnN8RukfSiwRhSToj81uU/pub) that this PR will be evaluated against.\r\n\r\nEnsuring that the above checkboxes are completed will help speed the review process and help build a stronger application.  Thanks!"},"comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments/218493962","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/392#issuecomment-218493962","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/392","id":218493962,"user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T15:24:22Z","updated_at":"2016-05-11T15:24:22Z","body":"@sfount, could this get a quick review?"}}