{"action":"created","issue":{"url":"https://api.github.com/repos/hull/hull-node/issues/8","labels_url":"https://api.github.com/repos/hull/hull-node/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/hull/hull-node/issues/8/comments","events_url":"https://api.github.com/repos/hull/hull-node/issues/8/events","html_url":"https://github.com/hull/hull-node/pull/8","id":123817645,"number":8,"title":"fix current user middleware and npm issues","user":{"login":"agonbina","id":3496783,"avatar_url":"https://avatars.githubusercontent.com/u/3496783?v=3","gravatar_id":"","url":"https://api.github.com/users/agonbina","html_url":"https://github.com/agonbina","followers_url":"https://api.github.com/users/agonbina/followers","following_url":"https://api.github.com/users/agonbina/following{/other_user}","gists_url":"https://api.github.com/users/agonbina/gists{/gist_id}","starred_url":"https://api.github.com/users/agonbina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agonbina/subscriptions","organizations_url":"https://api.github.com/users/agonbina/orgs","repos_url":"https://api.github.com/users/agonbina/repos","events_url":"https://api.github.com/users/agonbina/events{/privacy}","received_events_url":"https://api.github.com/users/agonbina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-24T16:13:06Z","updated_at":"2015-12-28T11:54:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hull/hull-node/pulls/8","html_url":"https://github.com/hull/hull-node/pull/8","diff_url":"https://github.com/hull/hull-node/pull/8.diff","patch_url":"https://github.com/hull/hull-node/pull/8.patch"},"body":"So I spent close to an hour trying to get the current user middleware to work, and it seems like the code was not even tested locally to see if it is working or not :-1: \r\n\r\nThis pr fixes two issues:\r\n1. Module not being exported correctly, if you install through `npm` the `main` property in package.json is set to `dist/index.js` but the gulp build will output to a folder by the name `lib`, so that should be used instead.\r\n2. The configuration was not being passed correctly to the middleware, as well as next was not being called to move through the middleware stack.\r\n\r\nBest,\r\nAgon"},"comment":{"url":"https://api.github.com/repos/hull/hull-node/issues/comments/167551219","html_url":"https://github.com/hull/hull-node/pull/8#issuecomment-167551219","issue_url":"https://api.github.com/repos/hull/hull-node/issues/8","id":167551219,"user":{"login":"unity","id":9458,"avatar_url":"https://avatars.githubusercontent.com/u/9458?v=3","gravatar_id":"","url":"https://api.github.com/users/unity","html_url":"https://github.com/unity","followers_url":"https://api.github.com/users/unity/followers","following_url":"https://api.github.com/users/unity/following{/other_user}","gists_url":"https://api.github.com/users/unity/gists{/gist_id}","starred_url":"https://api.github.com/users/unity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unity/subscriptions","organizations_url":"https://api.github.com/users/unity/orgs","repos_url":"https://api.github.com/users/unity/repos","events_url":"https://api.github.com/users/unity/events{/privacy}","received_events_url":"https://api.github.com/users/unity/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T11:54:05Z","updated_at":"2015-12-28T11:54:05Z","body":"We'll merge your PR, it's great!\r\n\r\nOTOH I don't think your proposed implementation of throwing an error if the user isn't logged should be the default behaviour. Not having a User isn't an error per se.\r\nI think the middleware should be seen as an enrichment layer to the response object; Just as a cookie middleware shouldn't throw if there's no cookie, the Identity middleware shouldn't throw if there's no user. \r\n\r\nAny thoughts?"}}