{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/team3/pulls/comments/56752233","id":56752233,"diff_hunk":"@@ -11,12 +15,26 @@ exports.login = (req, res) => {\n exports.registerAction = (req, res, next) => {\n     var user = {\n         login: req.body.email,\n-        password: req.body.password,\n-        id: req.body.email\n+        password: req.body.password\n     };\n-    passport.login.push(user);\n-    req.login(user, function (err) {\n-        return err ? next(err) : res.redirect('/');\n+    mLab.listDocuments({\n+        database: dbName,\n+        collectionName: collection,\n+        query: '{ \"login\": \"' + user.login + '\" }'\n+    }, (err, result) => {\n+        if (!err && !result.length) {\n+            passport.addUser(user, next);\n+            req.login(user, err => {\n+                if (err) {\n+                    next(err);\n+                } else {\n+                    res.redirect('/');\n+                }\n+                // err ? next(err) : res.redirect('/');","path":"controllers/passport.js","position":33,"original_position":33,"commit_id":"a4a284cb324341d78d8e16a605a38ffd83f28d9b","original_commit_id":"a4a284cb324341d78d8e16a605a38ffd83f28d9b","user":{"login":"lifeandfree","id":7126669,"avatar_url":"https://avatars.githubusercontent.com/u/7126669?v=3","gravatar_id":"","url":"https://api.github.com/users/lifeandfree","html_url":"https://github.com/lifeandfree","followers_url":"https://api.github.com/users/lifeandfree/followers","following_url":"https://api.github.com/users/lifeandfree/following{/other_user}","gists_url":"https://api.github.com/users/lifeandfree/gists{/gist_id}","starred_url":"https://api.github.com/users/lifeandfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifeandfree/subscriptions","organizations_url":"https://api.github.com/users/lifeandfree/orgs","repos_url":"https://api.github.com/users/lifeandfree/repos","events_url":"https://api.github.com/users/lifeandfree/events{/privacy}","received_events_url":"https://api.github.com/users/lifeandfree/received_events","type":"User","site_admin":false},"body":"нашел в настройках eslint надо добавить \"no-unused-expressions\": [2, { \"allowShortCircuit\": true, \"allowTernary\": true }] в поле rules в файле eslintrc.json","created_at":"2016-03-19T17:45:23Z","updated_at":"2016-03-19T17:45:23Z","html_url":"https://github.com/urfu-2015/team3/pull/42#discussion_r56752233","pull_request_url":"https://api.github.com/repos/urfu-2015/team3/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/comments/56752233"},"html":{"href":"https://github.com/urfu-2015/team3/pull/42#discussion_r56752233"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/team3/pulls/42","id":63411352,"html_url":"https://github.com/urfu-2015/team3/pull/42","diff_url":"https://github.com/urfu-2015/team3/pull/42.diff","patch_url":"https://github.com/urfu-2015/team3/pull/42.patch","issue_url":"https://api.github.com/repos/urfu-2015/team3/issues/42","number":42,"state":"open","locked":false,"title":"авторизация","user":{"login":"onufrienko","id":14929766,"avatar_url":"https://avatars.githubusercontent.com/u/14929766?v=3","gravatar_id":"","url":"https://api.github.com/users/onufrienko","html_url":"https://github.com/onufrienko","followers_url":"https://api.github.com/users/onufrienko/followers","following_url":"https://api.github.com/users/onufrienko/following{/other_user}","gists_url":"https://api.github.com/users/onufrienko/gists{/gist_id}","starred_url":"https://api.github.com/users/onufrienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onufrienko/subscriptions","organizations_url":"https://api.github.com/users/onufrienko/orgs","repos_url":"https://api.github.com/users/onufrienko/repos","events_url":"https://api.github.com/users/onufrienko/events{/privacy}","received_events_url":"https://api.github.com/users/onufrienko/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-18T17:44:05Z","updated_at":"2016-03-19T17:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"lifeandfree","id":7126669,"avatar_url":"https://avatars.githubusercontent.com/u/7126669?v=3","gravatar_id":"","url":"https://api.github.com/users/lifeandfree","html_url":"https://github.com/lifeandfree","followers_url":"https://api.github.com/users/lifeandfree/followers","following_url":"https://api.github.com/users/lifeandfree/following{/other_user}","gists_url":"https://api.github.com/users/lifeandfree/gists{/gist_id}","starred_url":"https://api.github.com/users/lifeandfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifeandfree/subscriptions","organizations_url":"https://api.github.com/users/lifeandfree/orgs","repos_url":"https://api.github.com/users/lifeandfree/repos","events_url":"https://api.github.com/users/lifeandfree/events{/privacy}","received_events_url":"https://api.github.com/users/lifeandfree/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/team3/pulls/42/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/team3/pulls/42/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/team3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/team3/issues/42/comments","statuses_url":"https://api.github.com/repos/urfu-2015/team3/statuses/a4a284cb324341d78d8e16a605a38ffd83f28d9b","head":{"label":"onufrienko:master","ref":"master","sha":"a4a284cb324341d78d8e16a605a38ffd83f28d9b","user":{"login":"onufrienko","id":14929766,"avatar_url":"https://avatars.githubusercontent.com/u/14929766?v=3","gravatar_id":"","url":"https://api.github.com/users/onufrienko","html_url":"https://github.com/onufrienko","followers_url":"https://api.github.com/users/onufrienko/followers","following_url":"https://api.github.com/users/onufrienko/following{/other_user}","gists_url":"https://api.github.com/users/onufrienko/gists{/gist_id}","starred_url":"https://api.github.com/users/onufrienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onufrienko/subscriptions","organizations_url":"https://api.github.com/users/onufrienko/orgs","repos_url":"https://api.github.com/users/onufrienko/repos","events_url":"https://api.github.com/users/onufrienko/events{/privacy}","received_events_url":"https://api.github.com/users/onufrienko/received_events","type":"User","site_admin":false},"repo":{"id":53771071,"name":"team3","full_name":"onufrienko/team3","owner":{"login":"onufrienko","id":14929766,"avatar_url":"https://avatars.githubusercontent.com/u/14929766?v=3","gravatar_id":"","url":"https://api.github.com/users/onufrienko","html_url":"https://github.com/onufrienko","followers_url":"https://api.github.com/users/onufrienko/followers","following_url":"https://api.github.com/users/onufrienko/following{/other_user}","gists_url":"https://api.github.com/users/onufrienko/gists{/gist_id}","starred_url":"https://api.github.com/users/onufrienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onufrienko/subscriptions","organizations_url":"https://api.github.com/users/onufrienko/orgs","repos_url":"https://api.github.com/users/onufrienko/repos","events_url":"https://api.github.com/users/onufrienko/events{/privacy}","received_events_url":"https://api.github.com/users/onufrienko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onufrienko/team3","description":"","fork":true,"url":"https://api.github.com/repos/onufrienko/team3","forks_url":"https://api.github.com/repos/onufrienko/team3/forks","keys_url":"https://api.github.com/repos/onufrienko/team3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onufrienko/team3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onufrienko/team3/teams","hooks_url":"https://api.github.com/repos/onufrienko/team3/hooks","issue_events_url":"https://api.github.com/repos/onufrienko/team3/issues/events{/number}","events_url":"https://api.github.com/repos/onufrienko/team3/events","assignees_url":"https://api.github.com/repos/onufrienko/team3/assignees{/user}","branches_url":"https://api.github.com/repos/onufrienko/team3/branches{/branch}","tags_url":"https://api.github.com/repos/onufrienko/team3/tags","blobs_url":"https://api.github.com/repos/onufrienko/team3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onufrienko/team3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onufrienko/team3/git/refs{/sha}","trees_url":"https://api.github.com/repos/onufrienko/team3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onufrienko/team3/statuses/{sha}","languages_url":"https://api.github.com/repos/onufrienko/team3/languages","stargazers_url":"https://api.github.com/repos/onufrienko/team3/stargazers","contributors_url":"https://api.github.com/repos/onufrienko/team3/contributors","subscribers_url":"https://api.github.com/repos/onufrienko/team3/subscribers","subscription_url":"https://api.github.com/repos/onufrienko/team3/subscription","commits_url":"https://api.github.com/repos/onufrienko/team3/commits{/sha}","git_commits_url":"https://api.github.com/repos/onufrienko/team3/git/commits{/sha}","comments_url":"https://api.github.com/repos/onufrienko/team3/comments{/number}","issue_comment_url":"https://api.github.com/repos/onufrienko/team3/issues/comments{/number}","contents_url":"https://api.github.com/repos/onufrienko/team3/contents/{+path}","compare_url":"https://api.github.com/repos/onufrienko/team3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onufrienko/team3/merges","archive_url":"https://api.github.com/repos/onufrienko/team3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onufrienko/team3/downloads","issues_url":"https://api.github.com/repos/onufrienko/team3/issues{/number}","pulls_url":"https://api.github.com/repos/onufrienko/team3/pulls{/number}","milestones_url":"https://api.github.com/repos/onufrienko/team3/milestones{/number}","notifications_url":"https://api.github.com/repos/onufrienko/team3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onufrienko/team3/labels{/name}","releases_url":"https://api.github.com/repos/onufrienko/team3/releases{/id}","deployments_url":"https://api.github.com/repos/onufrienko/team3/deployments","created_at":"2016-03-13T06:34:18Z","updated_at":"2016-03-13T07:22:09Z","pushed_at":"2016-03-18T17:39:33Z","git_url":"git://github.com/onufrienko/team3.git","ssh_url":"git@github.com:onufrienko/team3.git","clone_url":"https://github.com/onufrienko/team3.git","svn_url":"https://github.com/onufrienko/team3","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"urfu-2015:master","ref":"master","sha":"e96ef726aa50cc149832544fa0c676b1559e7906","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":53662806,"name":"team3","full_name":"urfu-2015/team3","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/team3","description":"","fork":false,"url":"https://api.github.com/repos/urfu-2015/team3","forks_url":"https://api.github.com/repos/urfu-2015/team3/forks","keys_url":"https://api.github.com/repos/urfu-2015/team3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/team3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/team3/teams","hooks_url":"https://api.github.com/repos/urfu-2015/team3/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/team3/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/team3/events","assignees_url":"https://api.github.com/repos/urfu-2015/team3/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/team3/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/team3/tags","blobs_url":"https://api.github.com/repos/urfu-2015/team3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/team3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/team3/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/team3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/team3/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/team3/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/team3/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/team3/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/team3/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/team3/subscription","commits_url":"https://api.github.com/repos/urfu-2015/team3/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/team3/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/team3/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/team3/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/team3/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/team3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/team3/merges","archive_url":"https://api.github.com/repos/urfu-2015/team3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/team3/downloads","issues_url":"https://api.github.com/repos/urfu-2015/team3/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/team3/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/team3/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/team3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/team3/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/team3/releases{/id}","deployments_url":"https://api.github.com/repos/urfu-2015/team3/deployments","created_at":"2016-03-11T11:33:21Z","updated_at":"2016-03-13T06:53:05Z","pushed_at":"2016-03-18T17:44:05Z","git_url":"git://github.com/urfu-2015/team3.git","ssh_url":"git@github.com:urfu-2015/team3.git","clone_url":"https://github.com/urfu-2015/team3.git","svn_url":"https://github.com/urfu-2015/team3","homepage":null,"size":45,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":16,"forks":7,"open_issues":16,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/42"},"html":{"href":"https://github.com/urfu-2015/team3/pull/42"},"issue":{"href":"https://api.github.com/repos/urfu-2015/team3/issues/42"},"comments":{"href":"https://api.github.com/repos/urfu-2015/team3/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/team3/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/team3/statuses/a4a284cb324341d78d8e16a605a38ffd83f28d9b"}}}}