{"action":"created","comment":{"url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/comments/56181237","id":56181237,"diff_hunk":"@@ -59,28 +61,33 @@\n \n     login: function(req, res, next) {\n       //get user from body\n-      User.findOne({username: req.body.username})\n-        .select('password')\n+      User.findOne({})\n+        .where('username').equals(req.body.username)\n+        .select('password role name')\n         .exec(function(err, user) {\n         if (err) {\n           next(err);\n         }\n         if(!user) {\n           res.send({\n-            message: 'Wrong username'\n+            error: {\n+                message: 'Wrong username'\n+              }\n           });\n         } else if (user) {\n           //check password\n           let correct = user.checkPass(req.body.password);\n           if (!correct) {\n             res.status(500).send({\n-              message: 'Invalid password'\n+              error: {\n+                message: 'Invalid password'\n+              }\n             });\n             next(err);\n           } else {\n-            let userData = us.pick(user, '_id', 'username', 'name', 'email'),\n+            let userData = us.pick(user, '_id', 'username', 'role', 'name', 'email'),","path":"server/controllers/userController.js","position":44,"original_position":44,"commit_id":"eda5b479972a50470734f043768ffb5e94a3b82b","original_commit_id":"eda5b479972a50470734f043768ffb5e94a3b82b","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long.<br>'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).","created_at":"2016-03-15T15:20:51Z","updated_at":"2016-03-15T15:20:51Z","html_url":"https://github.com/andela-ekupara/dcman/pull/9#discussion_r56181237","pull_request_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/comments/56181237"},"html":{"href":"https://github.com/andela-ekupara/dcman/pull/9#discussion_r56181237"},"pull_request":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9","id":62923072,"html_url":"https://github.com/andela-ekupara/dcman/pull/9","diff_url":"https://github.com/andela-ekupara/dcman/pull/9.diff","patch_url":"https://github.com/andela-ekupara/dcman/pull/9.patch","issue_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/9","number":9,"state":"open","locked":false,"title":"Develop rebasing","user":{"login":"andela-ekupara","id":16223673,"avatar_url":"https://avatars.githubusercontent.com/u/16223673?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ekupara","html_url":"https://github.com/andela-ekupara","followers_url":"https://api.github.com/users/andela-ekupara/followers","following_url":"https://api.github.com/users/andela-ekupara/following{/other_user}","gists_url":"https://api.github.com/users/andela-ekupara/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ekupara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ekupara/subscriptions","organizations_url":"https://api.github.com/users/andela-ekupara/orgs","repos_url":"https://api.github.com/users/andela-ekupara/repos","events_url":"https://api.github.com/users/andela-ekupara/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ekupara/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-15T15:20:31Z","updated_at":"2016-03-15T15:20:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"feac195de7d97f12d0139fe82c341b914edbc2f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9/commits","review_comments_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9/comments","review_comment_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/9/comments","statuses_url":"https://api.github.com/repos/andela-ekupara/dcman/statuses/eda5b479972a50470734f043768ffb5e94a3b82b","head":{"label":"andela-ekupara:develop","ref":"develop","sha":"eda5b479972a50470734f043768ffb5e94a3b82b","user":{"login":"andela-ekupara","id":16223673,"avatar_url":"https://avatars.githubusercontent.com/u/16223673?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ekupara","html_url":"https://github.com/andela-ekupara","followers_url":"https://api.github.com/users/andela-ekupara/followers","following_url":"https://api.github.com/users/andela-ekupara/following{/other_user}","gists_url":"https://api.github.com/users/andela-ekupara/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ekupara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ekupara/subscriptions","organizations_url":"https://api.github.com/users/andela-ekupara/orgs","repos_url":"https://api.github.com/users/andela-ekupara/repos","events_url":"https://api.github.com/users/andela-ekupara/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ekupara/received_events","type":"User","site_admin":false},"repo":{"id":52876155,"name":"dcman","full_name":"andela-ekupara/dcman","owner":{"login":"andela-ekupara","id":16223673,"avatar_url":"https://avatars.githubusercontent.com/u/16223673?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ekupara","html_url":"https://github.com/andela-ekupara","followers_url":"https://api.github.com/users/andela-ekupara/followers","following_url":"https://api.github.com/users/andela-ekupara/following{/other_user}","gists_url":"https://api.github.com/users/andela-ekupara/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ekupara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ekupara/subscriptions","organizations_url":"https://api.github.com/users/andela-ekupara/orgs","repos_url":"https://api.github.com/users/andela-ekupara/repos","events_url":"https://api.github.com/users/andela-ekupara/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ekupara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-ekupara/dcman","description":"Document Management API","fork":false,"url":"https://api.github.com/repos/andela-ekupara/dcman","forks_url":"https://api.github.com/repos/andela-ekupara/dcman/forks","keys_url":"https://api.github.com/repos/andela-ekupara/dcman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-ekupara/dcman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-ekupara/dcman/teams","hooks_url":"https://api.github.com/repos/andela-ekupara/dcman/hooks","issue_events_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/events{/number}","events_url":"https://api.github.com/repos/andela-ekupara/dcman/events","assignees_url":"https://api.github.com/repos/andela-ekupara/dcman/assignees{/user}","branches_url":"https://api.github.com/repos/andela-ekupara/dcman/branches{/branch}","tags_url":"https://api.github.com/repos/andela-ekupara/dcman/tags","blobs_url":"https://api.github.com/repos/andela-ekupara/dcman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-ekupara/dcman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-ekupara/dcman/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-ekupara/dcman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-ekupara/dcman/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-ekupara/dcman/languages","stargazers_url":"https://api.github.com/repos/andela-ekupara/dcman/stargazers","contributors_url":"https://api.github.com/repos/andela-ekupara/dcman/contributors","subscribers_url":"https://api.github.com/repos/andela-ekupara/dcman/subscribers","subscription_url":"https://api.github.com/repos/andela-ekupara/dcman/subscription","commits_url":"https://api.github.com/repos/andela-ekupara/dcman/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-ekupara/dcman/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-ekupara/dcman/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-ekupara/dcman/contents/{+path}","compare_url":"https://api.github.com/repos/andela-ekupara/dcman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-ekupara/dcman/merges","archive_url":"https://api.github.com/repos/andela-ekupara/dcman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-ekupara/dcman/downloads","issues_url":"https://api.github.com/repos/andela-ekupara/dcman/issues{/number}","pulls_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-ekupara/dcman/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-ekupara/dcman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-ekupara/dcman/labels{/name}","releases_url":"https://api.github.com/repos/andela-ekupara/dcman/releases{/id}","deployments_url":"https://api.github.com/repos/andela-ekupara/dcman/deployments","created_at":"2016-03-01T12:46:07Z","updated_at":"2016-03-03T08:20:11Z","pushed_at":"2016-03-15T15:20:31Z","git_url":"git://github.com/andela-ekupara/dcman.git","ssh_url":"git@github.com:andela-ekupara/dcman.git","clone_url":"https://github.com/andela-ekupara/dcman.git","svn_url":"https://github.com/andela-ekupara/dcman","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"andela-ekupara:master","ref":"master","sha":"dd4f89b0d97110c6b0a260b9f227f2594fcca5d3","user":{"login":"andela-ekupara","id":16223673,"avatar_url":"https://avatars.githubusercontent.com/u/16223673?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ekupara","html_url":"https://github.com/andela-ekupara","followers_url":"https://api.github.com/users/andela-ekupara/followers","following_url":"https://api.github.com/users/andela-ekupara/following{/other_user}","gists_url":"https://api.github.com/users/andela-ekupara/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ekupara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ekupara/subscriptions","organizations_url":"https://api.github.com/users/andela-ekupara/orgs","repos_url":"https://api.github.com/users/andela-ekupara/repos","events_url":"https://api.github.com/users/andela-ekupara/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ekupara/received_events","type":"User","site_admin":false},"repo":{"id":52876155,"name":"dcman","full_name":"andela-ekupara/dcman","owner":{"login":"andela-ekupara","id":16223673,"avatar_url":"https://avatars.githubusercontent.com/u/16223673?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ekupara","html_url":"https://github.com/andela-ekupara","followers_url":"https://api.github.com/users/andela-ekupara/followers","following_url":"https://api.github.com/users/andela-ekupara/following{/other_user}","gists_url":"https://api.github.com/users/andela-ekupara/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ekupara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ekupara/subscriptions","organizations_url":"https://api.github.com/users/andela-ekupara/orgs","repos_url":"https://api.github.com/users/andela-ekupara/repos","events_url":"https://api.github.com/users/andela-ekupara/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ekupara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-ekupara/dcman","description":"Document Management API","fork":false,"url":"https://api.github.com/repos/andela-ekupara/dcman","forks_url":"https://api.github.com/repos/andela-ekupara/dcman/forks","keys_url":"https://api.github.com/repos/andela-ekupara/dcman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-ekupara/dcman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-ekupara/dcman/teams","hooks_url":"https://api.github.com/repos/andela-ekupara/dcman/hooks","issue_events_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/events{/number}","events_url":"https://api.github.com/repos/andela-ekupara/dcman/events","assignees_url":"https://api.github.com/repos/andela-ekupara/dcman/assignees{/user}","branches_url":"https://api.github.com/repos/andela-ekupara/dcman/branches{/branch}","tags_url":"https://api.github.com/repos/andela-ekupara/dcman/tags","blobs_url":"https://api.github.com/repos/andela-ekupara/dcman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-ekupara/dcman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-ekupara/dcman/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-ekupara/dcman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-ekupara/dcman/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-ekupara/dcman/languages","stargazers_url":"https://api.github.com/repos/andela-ekupara/dcman/stargazers","contributors_url":"https://api.github.com/repos/andela-ekupara/dcman/contributors","subscribers_url":"https://api.github.com/repos/andela-ekupara/dcman/subscribers","subscription_url":"https://api.github.com/repos/andela-ekupara/dcman/subscription","commits_url":"https://api.github.com/repos/andela-ekupara/dcman/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-ekupara/dcman/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-ekupara/dcman/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-ekupara/dcman/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-ekupara/dcman/contents/{+path}","compare_url":"https://api.github.com/repos/andela-ekupara/dcman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-ekupara/dcman/merges","archive_url":"https://api.github.com/repos/andela-ekupara/dcman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-ekupara/dcman/downloads","issues_url":"https://api.github.com/repos/andela-ekupara/dcman/issues{/number}","pulls_url":"https://api.github.com/repos/andela-ekupara/dcman/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-ekupara/dcman/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-ekupara/dcman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-ekupara/dcman/labels{/name}","releases_url":"https://api.github.com/repos/andela-ekupara/dcman/releases{/id}","deployments_url":"https://api.github.com/repos/andela-ekupara/dcman/deployments","created_at":"2016-03-01T12:46:07Z","updated_at":"2016-03-03T08:20:11Z","pushed_at":"2016-03-15T15:20:31Z","git_url":"git://github.com/andela-ekupara/dcman.git","ssh_url":"git@github.com:andela-ekupara/dcman.git","clone_url":"https://github.com/andela-ekupara/dcman.git","svn_url":"https://github.com/andela-ekupara/dcman","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9"},"html":{"href":"https://github.com/andela-ekupara/dcman/pull/9"},"issue":{"href":"https://api.github.com/repos/andela-ekupara/dcman/issues/9"},"comments":{"href":"https://api.github.com/repos/andela-ekupara/dcman/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-ekupara/dcman/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/andela-ekupara/dcman/statuses/eda5b479972a50470734f043768ffb5e94a3b82b"}}}}