{"action":"created","comment":{"url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/comments/184962696","pull_request_review_id":116241500,"id":184962696,"diff_hunk":"@@ -1,35 +1,26 @@\n-import Syncano from 'syncano-server';\n-\n-export default (ctx) => {\n-  const { response, users } = Syncano(ctx);\n+import Syncano from '@syncano/core';\n+import validateRequired from './utils/helpers';\n \n+export default async (ctx) => {\n+  const { response, users } = new Syncano(ctx);\n   const { username, token } = ctx.args;\n \n-  /**\n-   * Check if face auth is enabled in user account\n-   * @param {object} data\n-   * @returns {*} response\n-   */\n-  const verifyUserFaceAuthRegistered = (data) => {\n-    if (data.user_key !== token) {\n-      return response.json({\n-        message: 'Given credentials does not match any user account.'\n-      }, 401);\n-    } else if (!data.face_auth) {\n-      return response.json({\n-        message: 'Face auth not enabled on user account.', is_face_auth: false\n-      });\n-    }\n+  try {\n+    validateRequired({ username, token });\n \n-    return response.json({\n-      message: 'Face auth enabled on user account.', is_face_auth: true\n-    });\n-  };\n+    const result = await users.where('username', username).firstOrFail();","path":"src/verify-face-auth.js","position":34,"original_position":34,"commit_id":"da98537de4df9a69815fb0eb0f7e9fccbfbbfbf6","original_commit_id":"da98537de4df9a69815fb0eb0f7e9fccbfbbfbf6","user":{"login":"adamwardecki","id":1017097,"avatar_url":"https://avatars1.githubusercontent.com/u/1017097?v=4","gravatar_id":"","url":"https://api.github.com/users/adamwardecki","html_url":"https://github.com/adamwardecki","followers_url":"https://api.github.com/users/adamwardecki/followers","following_url":"https://api.github.com/users/adamwardecki/following{/other_user}","gists_url":"https://api.github.com/users/adamwardecki/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwardecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwardecki/subscriptions","organizations_url":"https://api.github.com/users/adamwardecki/orgs","repos_url":"https://api.github.com/users/adamwardecki/repos","events_url":"https://api.github.com/users/adamwardecki/events{/privacy}","received_events_url":"https://api.github.com/users/adamwardecki/received_events","type":"User","site_admin":false},"body":"`const { user_key, face_auth } = await`","created_at":"2018-04-30T11:27:53Z","updated_at":"2018-04-30T11:28:39Z","html_url":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2#discussion_r184962696","pull_request_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/comments/184962696"},"html":{"href":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2#discussion_r184962696"},"pull_request":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2","id":163911735,"html_url":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2","diff_url":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2.diff","patch_url":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2.patch","issue_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/2","number":2,"state":"open","locked":false,"title":"Update face auth socket","user":{"login":"andela-eshaibu","id":25608317,"avatar_url":"https://avatars3.githubusercontent.com/u/25608317?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-eshaibu","html_url":"https://github.com/andela-eshaibu","followers_url":"https://api.github.com/users/andela-eshaibu/followers","following_url":"https://api.github.com/users/andela-eshaibu/following{/other_user}","gists_url":"https://api.github.com/users/andela-eshaibu/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-eshaibu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-eshaibu/subscriptions","organizations_url":"https://api.github.com/users/andela-eshaibu/orgs","repos_url":"https://api.github.com/users/andela-eshaibu/repos","events_url":"https://api.github.com/users/andela-eshaibu/events{/privacy}","received_events_url":"https://api.github.com/users/andela-eshaibu/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-01-19T08:34:11Z","updated_at":"2018-04-30T11:28:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b41b28abd18f0ca64f52edeeede96b1a75dd3446","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/2/comments","statuses_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/statuses/da98537de4df9a69815fb0eb0f7e9fccbfbbfbf6","head":{"label":"Syncano:ft_collection_config","ref":"ft_collection_config","sha":"da98537de4df9a69815fb0eb0f7e9fccbfbbfbf6","user":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars2.githubusercontent.com/u/6367703?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"repo":{"id":113020771,"name":"syncano-socket-aws-face-auth","full_name":"Syncano/syncano-socket-aws-face-auth","owner":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars2.githubusercontent.com/u/6367703?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Syncano/syncano-socket-aws-face-auth","description":null,"fork":false,"url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth","forks_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/forks","keys_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/teams","hooks_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/hooks","issue_events_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/events","assignees_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/tags","blobs_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/languages","stargazers_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/stargazers","contributors_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/contributors","subscribers_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/subscribers","subscription_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/subscription","commits_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/merges","archive_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/downloads","issues_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/labels{/name}","releases_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/deployments","created_at":"2017-12-04T09:12:58Z","updated_at":"2017-12-04T09:21:32Z","pushed_at":"2018-04-30T05:34:14Z","git_url":"git://github.com/Syncano/syncano-socket-aws-face-auth.git","ssh_url":"git@github.com:Syncano/syncano-socket-aws-face-auth.git","clone_url":"https://github.com/Syncano/syncano-socket-aws-face-auth.git","svn_url":"https://github.com/Syncano/syncano-socket-aws-face-auth","homepage":null,"size":402,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Syncano:master","ref":"master","sha":"5f69650adae4f1fdeab06c6b5df22a4ad658ffdb","user":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars2.githubusercontent.com/u/6367703?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"repo":{"id":113020771,"name":"syncano-socket-aws-face-auth","full_name":"Syncano/syncano-socket-aws-face-auth","owner":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars2.githubusercontent.com/u/6367703?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Syncano/syncano-socket-aws-face-auth","description":null,"fork":false,"url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth","forks_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/forks","keys_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/teams","hooks_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/hooks","issue_events_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/events","assignees_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/tags","blobs_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/languages","stargazers_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/stargazers","contributors_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/contributors","subscribers_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/subscribers","subscription_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/subscription","commits_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/merges","archive_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/downloads","issues_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/labels{/name}","releases_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/deployments","created_at":"2017-12-04T09:12:58Z","updated_at":"2017-12-04T09:21:32Z","pushed_at":"2018-04-30T05:34:14Z","git_url":"git://github.com/Syncano/syncano-socket-aws-face-auth.git","ssh_url":"git@github.com:Syncano/syncano-socket-aws-face-auth.git","clone_url":"https://github.com/Syncano/syncano-socket-aws-face-auth.git","svn_url":"https://github.com/Syncano/syncano-socket-aws-face-auth","homepage":null,"size":402,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2"},"html":{"href":"https://github.com/Syncano/syncano-socket-aws-face-auth/pull/2"},"issue":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/2"},"comments":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Syncano/syncano-socket-aws-face-auth/statuses/da98537de4df9a69815fb0eb0f7e9fccbfbbfbf6"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"adamwardecki"}}