{"action":"created","comment":{"url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/comments/84618302","pull_request_review_id":5384212,"id":84618302,"diff_hunk":"@@ -14,65 +14,155 @@ describe('Socket.io authentication', function() {\n \n   before(function(done) {\n     this.server = app.listen(PORT);\n-    this.server.once('listening', () => {\n-      socket = io(`http://localhost:${PORT}`);\n-      done();\n-    });\n+    this.server.once('listening', () => done());\n+  });\n+\n+  beforeEach(function() {\n+    socket = io(`http://localhost:${PORT}`);\n   });\n \n   after(function() {\n     this.server.close();\n   });\n \n   it('returns not authenticated error for protected endpoint', done => {\n+    socket.emit('todos::get', 'laundry', e => {\n+      delete e.stack;\n+      delete e.type;\n+\n+      expect(e).to.deep.equal({","path":"test/integration/socketio.test.js","position":30,"original_position":30,"commit_id":"0aec2286f019220f7f118c9de90e444b7b358756","original_commit_id":"0aec2286f019220f7f118c9de90e444b7b358756","user":{"login":"daffl","id":338316,"avatar_url":"https://avatars.githubusercontent.com/u/338316?v=3","gravatar_id":"","url":"https://api.github.com/users/daffl","html_url":"https://github.com/daffl","followers_url":"https://api.github.com/users/daffl/followers","following_url":"https://api.github.com/users/daffl/following{/other_user}","gists_url":"https://api.github.com/users/daffl/gists{/gist_id}","starred_url":"https://api.github.com/users/daffl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daffl/subscriptions","organizations_url":"https://api.github.com/users/daffl/orgs","repos_url":"https://api.github.com/users/daffl/repos","events_url":"https://api.github.com/users/daffl/events{/privacy}","received_events_url":"https://api.github.com/users/daffl/received_events","type":"User","site_admin":false},"body":"Word. I'll update that as well.","created_at":"2016-10-24T03:57:51Z","updated_at":"2016-10-24T03:57:51Z","html_url":"https://github.com/feathersjs/feathers-authentication/pull/324#discussion_r84618302","pull_request_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324","_links":{"self":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/comments/84618302"},"html":{"href":"https://github.com/feathersjs/feathers-authentication/pull/324#discussion_r84618302"},"pull_request":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324"}}},"pull_request":{"url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324","id":90531844,"html_url":"https://github.com/feathersjs/feathers-authentication/pull/324","diff_url":"https://github.com/feathersjs/feathers-authentication/pull/324.diff","patch_url":"https://github.com/feathersjs/feathers-authentication/pull/324.patch","issue_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/324","number":324,"state":"open","locked":false,"title":"Socket.io authentication tests and login logout event","user":{"login":"daffl","id":338316,"avatar_url":"https://avatars.githubusercontent.com/u/338316?v=3","gravatar_id":"","url":"https://api.github.com/users/daffl","html_url":"https://github.com/daffl","followers_url":"https://api.github.com/users/daffl/followers","following_url":"https://api.github.com/users/daffl/following{/other_user}","gists_url":"https://api.github.com/users/daffl/gists{/gist_id}","starred_url":"https://api.github.com/users/daffl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daffl/subscriptions","organizations_url":"https://api.github.com/users/daffl/orgs","repos_url":"https://api.github.com/users/daffl/repos","events_url":"https://api.github.com/users/daffl/events{/privacy}","received_events_url":"https://api.github.com/users/daffl/received_events","type":"User","site_admin":false},"body":"This pull request adds further tests for Socket.io authentication and implements login and logout events for it. Now it is possible to do this:\r\n\r\n```js\r\napp.on('login', function(authResult, info) {\r\n  // authResult -> result from app.authentication.authenticate\r\n  // info -> { socket, connection, provider }\r\n});\r\n\r\napp.on('logout', function(authResult, info) {\r\n  // authResult -> result from app.authentication.authenticate\r\n  // info -> { socket, connection, provider }\r\n});\r\n```\r\n\r\nGetting the `info` object is useful so that we can e.g. keep the connection up to date with the latest user information (or let people do other things outside of the abstracted service flow).","created_at":"2016-10-23T22:09:55Z","updated_at":"2016-10-24T03:57:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dff6cb5dc6cc3c629e6206b3dccd3a6fdb84c990","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324/commits","review_comments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324/comments","review_comment_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/comments{/number}","comments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/324/comments","statuses_url":"https://api.github.com/repos/feathersjs/feathers-authentication/statuses/0aec2286f019220f7f118c9de90e444b7b358756","head":{"label":"feathersjs:socketio-auth","ref":"socketio-auth","sha":"0aec2286f019220f7f118c9de90e444b7b358756","user":{"login":"feathersjs","id":5321853,"avatar_url":"https://avatars.githubusercontent.com/u/5321853?v=3","gravatar_id":"","url":"https://api.github.com/users/feathersjs","html_url":"https://github.com/feathersjs","followers_url":"https://api.github.com/users/feathersjs/followers","following_url":"https://api.github.com/users/feathersjs/following{/other_user}","gists_url":"https://api.github.com/users/feathersjs/gists{/gist_id}","starred_url":"https://api.github.com/users/feathersjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feathersjs/subscriptions","organizations_url":"https://api.github.com/users/feathersjs/orgs","repos_url":"https://api.github.com/users/feathersjs/repos","events_url":"https://api.github.com/users/feathersjs/events{/privacy}","received_events_url":"https://api.github.com/users/feathersjs/received_events","type":"Organization","site_admin":false},"repo":{"id":43711619,"name":"feathers-authentication","full_name":"feathersjs/feathers-authentication","owner":{"login":"feathersjs","id":5321853,"avatar_url":"https://avatars.githubusercontent.com/u/5321853?v=3","gravatar_id":"","url":"https://api.github.com/users/feathersjs","html_url":"https://github.com/feathersjs","followers_url":"https://api.github.com/users/feathersjs/followers","following_url":"https://api.github.com/users/feathersjs/following{/other_user}","gists_url":"https://api.github.com/users/feathersjs/gists{/gist_id}","starred_url":"https://api.github.com/users/feathersjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feathersjs/subscriptions","organizations_url":"https://api.github.com/users/feathersjs/orgs","repos_url":"https://api.github.com/users/feathersjs/repos","events_url":"https://api.github.com/users/feathersjs/events{/privacy}","received_events_url":"https://api.github.com/users/feathersjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feathersjs/feathers-authentication","description":"Feathers local, token, and OAuth authentication over REST and Websockets using JSON Web Tokens (JWT) with PassportJS.","fork":false,"url":"https://api.github.com/repos/feathersjs/feathers-authentication","forks_url":"https://api.github.com/repos/feathersjs/feathers-authentication/forks","keys_url":"https://api.github.com/repos/feathersjs/feathers-authentication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feathersjs/feathers-authentication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feathersjs/feathers-authentication/teams","hooks_url":"https://api.github.com/repos/feathersjs/feathers-authentication/hooks","issue_events_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/events{/number}","events_url":"https://api.github.com/repos/feathersjs/feathers-authentication/events","assignees_url":"https://api.github.com/repos/feathersjs/feathers-authentication/assignees{/user}","branches_url":"https://api.github.com/repos/feathersjs/feathers-authentication/branches{/branch}","tags_url":"https://api.github.com/repos/feathersjs/feathers-authentication/tags","blobs_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/refs{/sha}","trees_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feathersjs/feathers-authentication/statuses/{sha}","languages_url":"https://api.github.com/repos/feathersjs/feathers-authentication/languages","stargazers_url":"https://api.github.com/repos/feathersjs/feathers-authentication/stargazers","contributors_url":"https://api.github.com/repos/feathersjs/feathers-authentication/contributors","subscribers_url":"https://api.github.com/repos/feathersjs/feathers-authentication/subscribers","subscription_url":"https://api.github.com/repos/feathersjs/feathers-authentication/subscription","commits_url":"https://api.github.com/repos/feathersjs/feathers-authentication/commits{/sha}","git_commits_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/commits{/sha}","comments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/comments{/number}","issue_comment_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/comments{/number}","contents_url":"https://api.github.com/repos/feathersjs/feathers-authentication/contents/{+path}","compare_url":"https://api.github.com/repos/feathersjs/feathers-authentication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feathersjs/feathers-authentication/merges","archive_url":"https://api.github.com/repos/feathersjs/feathers-authentication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feathersjs/feathers-authentication/downloads","issues_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues{/number}","pulls_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls{/number}","milestones_url":"https://api.github.com/repos/feathersjs/feathers-authentication/milestones{/number}","notifications_url":"https://api.github.com/repos/feathersjs/feathers-authentication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feathersjs/feathers-authentication/labels{/name}","releases_url":"https://api.github.com/repos/feathersjs/feathers-authentication/releases{/id}","deployments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/deployments","created_at":"2015-10-05T20:22:25Z","updated_at":"2016-10-23T08:59:37Z","pushed_at":"2016-10-24T02:52:18Z","git_url":"git://github.com/feathersjs/feathers-authentication.git","ssh_url":"git@github.com:feathersjs/feathers-authentication.git","clone_url":"https://github.com/feathersjs/feathers-authentication.git","svn_url":"https://github.com/feathersjs/feathers-authentication","homepage":"","size":853,"stargazers_count":96,"watchers_count":96,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":56,"forks":45,"open_issues":56,"watchers":96,"default_branch":"master"}},"base":{"label":"feathersjs:modularization","ref":"modularization","sha":"80e0d0ae29e5f5ff80a1a1dcf54f4feb2eda0a39","user":{"login":"feathersjs","id":5321853,"avatar_url":"https://avatars.githubusercontent.com/u/5321853?v=3","gravatar_id":"","url":"https://api.github.com/users/feathersjs","html_url":"https://github.com/feathersjs","followers_url":"https://api.github.com/users/feathersjs/followers","following_url":"https://api.github.com/users/feathersjs/following{/other_user}","gists_url":"https://api.github.com/users/feathersjs/gists{/gist_id}","starred_url":"https://api.github.com/users/feathersjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feathersjs/subscriptions","organizations_url":"https://api.github.com/users/feathersjs/orgs","repos_url":"https://api.github.com/users/feathersjs/repos","events_url":"https://api.github.com/users/feathersjs/events{/privacy}","received_events_url":"https://api.github.com/users/feathersjs/received_events","type":"Organization","site_admin":false},"repo":{"id":43711619,"name":"feathers-authentication","full_name":"feathersjs/feathers-authentication","owner":{"login":"feathersjs","id":5321853,"avatar_url":"https://avatars.githubusercontent.com/u/5321853?v=3","gravatar_id":"","url":"https://api.github.com/users/feathersjs","html_url":"https://github.com/feathersjs","followers_url":"https://api.github.com/users/feathersjs/followers","following_url":"https://api.github.com/users/feathersjs/following{/other_user}","gists_url":"https://api.github.com/users/feathersjs/gists{/gist_id}","starred_url":"https://api.github.com/users/feathersjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feathersjs/subscriptions","organizations_url":"https://api.github.com/users/feathersjs/orgs","repos_url":"https://api.github.com/users/feathersjs/repos","events_url":"https://api.github.com/users/feathersjs/events{/privacy}","received_events_url":"https://api.github.com/users/feathersjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feathersjs/feathers-authentication","description":"Feathers local, token, and OAuth authentication over REST and Websockets using JSON Web Tokens (JWT) with PassportJS.","fork":false,"url":"https://api.github.com/repos/feathersjs/feathers-authentication","forks_url":"https://api.github.com/repos/feathersjs/feathers-authentication/forks","keys_url":"https://api.github.com/repos/feathersjs/feathers-authentication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feathersjs/feathers-authentication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feathersjs/feathers-authentication/teams","hooks_url":"https://api.github.com/repos/feathersjs/feathers-authentication/hooks","issue_events_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/events{/number}","events_url":"https://api.github.com/repos/feathersjs/feathers-authentication/events","assignees_url":"https://api.github.com/repos/feathersjs/feathers-authentication/assignees{/user}","branches_url":"https://api.github.com/repos/feathersjs/feathers-authentication/branches{/branch}","tags_url":"https://api.github.com/repos/feathersjs/feathers-authentication/tags","blobs_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/refs{/sha}","trees_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feathersjs/feathers-authentication/statuses/{sha}","languages_url":"https://api.github.com/repos/feathersjs/feathers-authentication/languages","stargazers_url":"https://api.github.com/repos/feathersjs/feathers-authentication/stargazers","contributors_url":"https://api.github.com/repos/feathersjs/feathers-authentication/contributors","subscribers_url":"https://api.github.com/repos/feathersjs/feathers-authentication/subscribers","subscription_url":"https://api.github.com/repos/feathersjs/feathers-authentication/subscription","commits_url":"https://api.github.com/repos/feathersjs/feathers-authentication/commits{/sha}","git_commits_url":"https://api.github.com/repos/feathersjs/feathers-authentication/git/commits{/sha}","comments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/comments{/number}","issue_comment_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/comments{/number}","contents_url":"https://api.github.com/repos/feathersjs/feathers-authentication/contents/{+path}","compare_url":"https://api.github.com/repos/feathersjs/feathers-authentication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feathersjs/feathers-authentication/merges","archive_url":"https://api.github.com/repos/feathersjs/feathers-authentication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feathersjs/feathers-authentication/downloads","issues_url":"https://api.github.com/repos/feathersjs/feathers-authentication/issues{/number}","pulls_url":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls{/number}","milestones_url":"https://api.github.com/repos/feathersjs/feathers-authentication/milestones{/number}","notifications_url":"https://api.github.com/repos/feathersjs/feathers-authentication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feathersjs/feathers-authentication/labels{/name}","releases_url":"https://api.github.com/repos/feathersjs/feathers-authentication/releases{/id}","deployments_url":"https://api.github.com/repos/feathersjs/feathers-authentication/deployments","created_at":"2015-10-05T20:22:25Z","updated_at":"2016-10-23T08:59:37Z","pushed_at":"2016-10-24T02:52:18Z","git_url":"git://github.com/feathersjs/feathers-authentication.git","ssh_url":"git@github.com:feathersjs/feathers-authentication.git","clone_url":"https://github.com/feathersjs/feathers-authentication.git","svn_url":"https://github.com/feathersjs/feathers-authentication","homepage":"","size":853,"stargazers_count":96,"watchers_count":96,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":56,"forks":45,"open_issues":56,"watchers":96,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324"},"html":{"href":"https://github.com/feathersjs/feathers-authentication/pull/324"},"issue":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/324"},"comments":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/issues/324/comments"},"review_comments":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324/comments"},"review_comment":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/pulls/324/commits"},"statuses":{"href":"https://api.github.com/repos/feathersjs/feathers-authentication/statuses/0aec2286f019220f7f118c9de90e444b7b358756"}}}}
{"actor":{"display_login":"daffl"}}