{"action":"created","comment":{"url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/comments/151364438","pull_request_review_id":77057392,"id":151364438,"diff_hunk":"@@ -0,0 +1,92 @@\n+const express = require(\"express\");\n+const bcrypt = require(\"bcrypt\");\n+const passport = require(\"passport\");\n+const ensureLogin = require(\"connect-ensure-login\");\n+\n+const User = require(\"../models/user\");\n+\n+const router = express.Router();\n+const bcryptSalt = 10;\n+\n+// PRIVATE\n+router.get(\"/private-page\", ensureLogin.ensureLoggedIn(), (req, res) => {\n+  res.render(\"passport/private\", { user: req.user });\n+});\n+\n+// LOGIN\n+router.get(\"/login\", (req, res, next) => {\n+  res.render(\"passport/login\");\n+});\n+\n+router.post(\n+  \"/login\",\n+  passport.authenticate(\"local\", {\n+    successRedirect: \"/private-page\",\n+    failureRedirect: \"/login\",\n+    failureFlash: true,\n+    passReqToCallback: true\n+  })\n+);\n+\n+// Post /logout\n+router.post(\"/logout\", function(req, res, next) {","path":"starter-code/routes/auth.js","position":32,"original_position":32,"commit_id":"d7da2ecf149d3a9a9dbb22dca0b4e8938390556d","original_commit_id":"d7da2ecf149d3a9a9dbb22dca0b4e8938390556d","user":{"login":"tawebbcn","id":26812171,"avatar_url":"https://avatars2.githubusercontent.com/u/26812171?v=4","gravatar_id":"","url":"https://api.github.com/users/tawebbcn","html_url":"https://github.com/tawebbcn","followers_url":"https://api.github.com/users/tawebbcn/followers","following_url":"https://api.github.com/users/tawebbcn/following{/other_user}","gists_url":"https://api.github.com/users/tawebbcn/gists{/gist_id}","starred_url":"https://api.github.com/users/tawebbcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tawebbcn/subscriptions","organizations_url":"https://api.github.com/users/tawebbcn/orgs","repos_url":"https://api.github.com/users/tawebbcn/repos","events_url":"https://api.github.com/users/tawebbcn/events{/privacy}","received_events_url":"https://api.github.com/users/tawebbcn/received_events","type":"User","site_admin":false},"body":"Better use a 'get' here .","created_at":"2017-11-16T09:47:55Z","updated_at":"2017-11-16T09:54:49Z","html_url":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125#discussion_r151364438","pull_request_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/comments/151364438"},"html":{"href":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125#discussion_r151364438"},"pull_request":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125","id":152245071,"html_url":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125","diff_url":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125.diff","patch_url":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125.patch","issue_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/125","number":125,"state":"open","locked":false,"title":"BCN- Torgeir, Constantinos","user":{"login":"cyenis","id":32722265,"avatar_url":"https://avatars3.githubusercontent.com/u/32722265?v=4","gravatar_id":"","url":"https://api.github.com/users/cyenis","html_url":"https://github.com/cyenis","followers_url":"https://api.github.com/users/cyenis/followers","following_url":"https://api.github.com/users/cyenis/following{/other_user}","gists_url":"https://api.github.com/users/cyenis/gists{/gist_id}","starred_url":"https://api.github.com/users/cyenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyenis/subscriptions","organizations_url":"https://api.github.com/users/cyenis/orgs","repos_url":"https://api.github.com/users/cyenis/repos","events_url":"https://api.github.com/users/cyenis/events{/privacy}","received_events_url":"https://api.github.com/users/cyenis/received_events","type":"User","site_admin":false},"body":"@torgeirbeyer @cyenis","created_at":"2017-11-13T14:00:50Z","updated_at":"2017-11-16T09:54:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aee8929087000e87bb306094ec8b6fb8527756c3","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125/commits","review_comments_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125/comments","review_comment_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/125/comments","statuses_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/statuses/d7da2ecf149d3a9a9dbb22dca0b4e8938390556d","head":{"label":"cyenis:master","ref":"master","sha":"d7da2ecf149d3a9a9dbb22dca0b4e8938390556d","user":{"login":"cyenis","id":32722265,"avatar_url":"https://avatars3.githubusercontent.com/u/32722265?v=4","gravatar_id":"","url":"https://api.github.com/users/cyenis","html_url":"https://github.com/cyenis","followers_url":"https://api.github.com/users/cyenis/followers","following_url":"https://api.github.com/users/cyenis/following{/other_user}","gists_url":"https://api.github.com/users/cyenis/gists{/gist_id}","starred_url":"https://api.github.com/users/cyenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyenis/subscriptions","organizations_url":"https://api.github.com/users/cyenis/orgs","repos_url":"https://api.github.com/users/cyenis/repos","events_url":"https://api.github.com/users/cyenis/events{/privacy}","received_events_url":"https://api.github.com/users/cyenis/received_events","type":"User","site_admin":false},"repo":{"id":110550688,"name":"lab-authentication-with-passport","full_name":"cyenis/lab-authentication-with-passport","owner":{"login":"cyenis","id":32722265,"avatar_url":"https://avatars3.githubusercontent.com/u/32722265?v=4","gravatar_id":"","url":"https://api.github.com/users/cyenis","html_url":"https://github.com/cyenis","followers_url":"https://api.github.com/users/cyenis/followers","following_url":"https://api.github.com/users/cyenis/following{/other_user}","gists_url":"https://api.github.com/users/cyenis/gists{/gist_id}","starred_url":"https://api.github.com/users/cyenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyenis/subscriptions","organizations_url":"https://api.github.com/users/cyenis/orgs","repos_url":"https://api.github.com/users/cyenis/repos","events_url":"https://api.github.com/users/cyenis/events{/privacy}","received_events_url":"https://api.github.com/users/cyenis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cyenis/lab-authentication-with-passport","description":null,"fork":true,"url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport","forks_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/forks","keys_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/teams","hooks_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/hooks","issue_events_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/issues/events{/number}","events_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/events","assignees_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/assignees{/user}","branches_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/branches{/branch}","tags_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/tags","blobs_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/statuses/{sha}","languages_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/languages","stargazers_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/stargazers","contributors_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/contributors","subscribers_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/subscribers","subscription_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/subscription","commits_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/contents/{+path}","compare_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/merges","archive_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/downloads","issues_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/issues{/number}","pulls_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/pulls{/number}","milestones_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/milestones{/number}","notifications_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/labels{/name}","releases_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/releases{/id}","deployments_url":"https://api.github.com/repos/cyenis/lab-authentication-with-passport/deployments","created_at":"2017-11-13T13:19:13Z","updated_at":"2017-11-13T13:19:15Z","pushed_at":"2017-11-13T15:10:09Z","git_url":"git://github.com/cyenis/lab-authentication-with-passport.git","ssh_url":"git@github.com:cyenis/lab-authentication-with-passport.git","clone_url":"https://github.com/cyenis/lab-authentication-with-passport.git","svn_url":"https://github.com/cyenis/lab-authentication-with-passport","homepage":null,"size":1727,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ironhack-labs:master","ref":"master","sha":"b4d69122458be37baf09017b5858a75897948ed2","user":{"login":"ironhack-labs","id":25032046,"avatar_url":"https://avatars3.githubusercontent.com/u/25032046?v=4","gravatar_id":"","url":"https://api.github.com/users/ironhack-labs","html_url":"https://github.com/ironhack-labs","followers_url":"https://api.github.com/users/ironhack-labs/followers","following_url":"https://api.github.com/users/ironhack-labs/following{/other_user}","gists_url":"https://api.github.com/users/ironhack-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/ironhack-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironhack-labs/subscriptions","organizations_url":"https://api.github.com/users/ironhack-labs/orgs","repos_url":"https://api.github.com/users/ironhack-labs/repos","events_url":"https://api.github.com/users/ironhack-labs/events{/privacy}","received_events_url":"https://api.github.com/users/ironhack-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":81660507,"name":"lab-authentication-with-passport","full_name":"ironhack-labs/lab-authentication-with-passport","owner":{"login":"ironhack-labs","id":25032046,"avatar_url":"https://avatars3.githubusercontent.com/u/25032046?v=4","gravatar_id":"","url":"https://api.github.com/users/ironhack-labs","html_url":"https://github.com/ironhack-labs","followers_url":"https://api.github.com/users/ironhack-labs/followers","following_url":"https://api.github.com/users/ironhack-labs/following{/other_user}","gists_url":"https://api.github.com/users/ironhack-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/ironhack-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironhack-labs/subscriptions","organizations_url":"https://api.github.com/users/ironhack-labs/orgs","repos_url":"https://api.github.com/users/ironhack-labs/repos","events_url":"https://api.github.com/users/ironhack-labs/events{/privacy}","received_events_url":"https://api.github.com/users/ironhack-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ironhack-labs/lab-authentication-with-passport","description":null,"fork":false,"url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport","forks_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/forks","keys_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/teams","hooks_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/hooks","issue_events_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/events{/number}","events_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/events","assignees_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/assignees{/user}","branches_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/branches{/branch}","tags_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/tags","blobs_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/git/refs{/sha}","trees_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/statuses/{sha}","languages_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/languages","stargazers_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/stargazers","contributors_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/contributors","subscribers_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/subscribers","subscription_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/subscription","commits_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/commits{/sha}","git_commits_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/git/commits{/sha}","comments_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/comments{/number}","issue_comment_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/comments{/number}","contents_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/contents/{+path}","compare_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/merges","archive_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/downloads","issues_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues{/number}","pulls_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls{/number}","milestones_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/milestones{/number}","notifications_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/labels{/name}","releases_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/releases{/id}","deployments_url":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/deployments","created_at":"2017-02-11T15:07:52Z","updated_at":"2017-11-09T19:49:09Z","pushed_at":"2017-11-13T23:43:29Z","git_url":"git://github.com/ironhack-labs/lab-authentication-with-passport.git","ssh_url":"git@github.com:ironhack-labs/lab-authentication-with-passport.git","clone_url":"https://github.com/ironhack-labs/lab-authentication-with-passport.git","svn_url":"https://github.com/ironhack-labs/lab-authentication-with-passport","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":200,"mirror_url":null,"archived":false,"open_issues_count":21,"forks":200,"open_issues":21,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125"},"html":{"href":"https://github.com/ironhack-labs/lab-authentication-with-passport/pull/125"},"issue":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/125"},"comments":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/ironhack-labs/lab-authentication-with-passport/statuses/d7da2ecf149d3a9a9dbb22dca0b4e8938390556d"}},"author_association":"NONE"}}
{"actor":{"display_login":"tawebbcn"}}