{"action":"created","comment":{"url":"https://api.github.com/repos/poster983/Passport-Live/pulls/comments/126813416","pull_request_review_id":49335784,"id":126813416,"diff_hunk":"@@ -0,0 +1,111 @@\n+/*\n+Passport-Live is a modern web app for schools that helps them manage passes.\n+    Copyright (C) 2017  Joseph Hassell\n+\n+    This program is free software: you can redistribute it and/or modify\n+    it under the terms of the GNU Affero General Public License as published\n+    by the Free Software Foundation, either version 3 of the License, or\n+    (at your option) any later version.\n+\n+    This program is distributed in the hope that it will be useful,\n+    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+    GNU Affero General Public License for more details.\n+\n+    You should have received a copy of the GNU Affero General Public License\n+    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\n+email: hi@josephhassell.com\n+*/\n+\n+/**\n+* @module authRESTAPI\n+*/\n+\n+var express = require('express');\n+var router = express.Router();\n+var passport = require('passport');\n+var api = require('../../modules/passport-api/auth.js');\n+\n+var cors = require('cors');\n+\n+router.use(cors());\n+router.options('*', cors())\n+\n+\n+//serializeUser becaule the default passport.serializeUser function wont be called without session\n+/**\n+* takes req.user and makes it useable in the session.  Called automaticly \n+* @function serializeUser\n+* @ignore\n+*/\n+function serializeUser(req, res, done) {\n+    console.log(req.user[0]);\n+    //REMOVE SECRET INFO LIKE PASSWORDS\n+    //delete req.user[0].password;\n+    //req.user = req.user[0];\n+    req.user = utils.cleanUser(req.user);\n+    done();\n+};\n+\n+/**\n+    * Logges the user in using passport.authenticate\n+    * @function handleAuthLogin\n+    * @async\n+    * @param {request} req\n+    * @param {response} res\n+    * @api POST /api/auth/login/\n+    * @apibody {application/x-www-form-urlencoded}\n+    * @example \n+    * <caption>Body structure: </caption>\n+    * email:<user's email>,\n+    * password:<user's password>\n+    * @todo Test application/json\n+    * @apiresponse {json} Returns in a json object with key: \"token\" and the value has a PassportJS compatible JWT\n+    * @todo Require passport to run over https.  Dissallow any website to use it\n+    */\n+router.post('/login', passport.authenticate('local-login', {","path":"routes/api/auth.js","position":67,"original_position":67,"commit_id":"a50add2209c3a470db27523da77104102814e543","original_commit_id":"a50add2209c3a470db27523da77104102814e543","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars2.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Strings must use doublequote. (quotes)](https://www.codacy.com/app/poster983/Passport-Live/pullRequest?prid=766261)","created_at":"2017-07-11T21:31:17Z","updated_at":"2017-07-11T21:31:17Z","html_url":"https://github.com/poster983/Passport-Live/pull/40#discussion_r126813416","pull_request_url":"https://api.github.com/repos/poster983/Passport-Live/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/comments/126813416"},"html":{"href":"https://github.com/poster983/Passport-Live/pull/40#discussion_r126813416"},"pull_request":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/poster983/Passport-Live/pulls/40","id":130007200,"html_url":"https://github.com/poster983/Passport-Live/pull/40","diff_url":"https://github.com/poster983/Passport-Live/pull/40.diff","patch_url":"https://github.com/poster983/Passport-Live/pull/40.patch","issue_url":"https://api.github.com/repos/poster983/Passport-Live/issues/40","number":40,"state":"open","locked":false,"title":"[wip] Added Api functions and endpointstosupport\"Double Submit Cookies Method\"","user":{"login":"poster983","id":6720066,"avatar_url":"https://avatars1.githubusercontent.com/u/6720066?v=3","gravatar_id":"","url":"https://api.github.com/users/poster983","html_url":"https://github.com/poster983","followers_url":"https://api.github.com/users/poster983/followers","following_url":"https://api.github.com/users/poster983/following{/other_user}","gists_url":"https://api.github.com/users/poster983/gists{/gist_id}","starred_url":"https://api.github.com/users/poster983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poster983/subscriptions","organizations_url":"https://api.github.com/users/poster983/orgs","repos_url":"https://api.github.com/users/poster983/repos","events_url":"https://api.github.com/users/poster983/events{/privacy}","received_events_url":"https://api.github.com/users/poster983/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-11T21:14:21Z","updated_at":"2017-07-11T21:31:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89570518f288aaa73278565e5e35df60777f4eec","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/poster983/Passport-Live/pulls/40/commits","review_comments_url":"https://api.github.com/repos/poster983/Passport-Live/pulls/40/comments","review_comment_url":"https://api.github.com/repos/poster983/Passport-Live/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poster983/Passport-Live/issues/40/comments","statuses_url":"https://api.github.com/repos/poster983/Passport-Live/statuses/a50add2209c3a470db27523da77104102814e543","head":{"label":"poster983:accountPageSchedules","ref":"accountPageSchedules","sha":"a50add2209c3a470db27523da77104102814e543","user":{"login":"poster983","id":6720066,"avatar_url":"https://avatars1.githubusercontent.com/u/6720066?v=3","gravatar_id":"","url":"https://api.github.com/users/poster983","html_url":"https://github.com/poster983","followers_url":"https://api.github.com/users/poster983/followers","following_url":"https://api.github.com/users/poster983/following{/other_user}","gists_url":"https://api.github.com/users/poster983/gists{/gist_id}","starred_url":"https://api.github.com/users/poster983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poster983/subscriptions","organizations_url":"https://api.github.com/users/poster983/orgs","repos_url":"https://api.github.com/users/poster983/repos","events_url":"https://api.github.com/users/poster983/events{/privacy}","received_events_url":"https://api.github.com/users/poster983/received_events","type":"User","site_admin":false},"repo":{"id":83609990,"name":"Passport-Live","full_name":"poster983/Passport-Live","owner":{"login":"poster983","id":6720066,"avatar_url":"https://avatars1.githubusercontent.com/u/6720066?v=3","gravatar_id":"","url":"https://api.github.com/users/poster983","html_url":"https://github.com/poster983","followers_url":"https://api.github.com/users/poster983/followers","following_url":"https://api.github.com/users/poster983/following{/other_user}","gists_url":"https://api.github.com/users/poster983/gists{/gist_id}","starred_url":"https://api.github.com/users/poster983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poster983/subscriptions","organizations_url":"https://api.github.com/users/poster983/orgs","repos_url":"https://api.github.com/users/poster983/repos","events_url":"https://api.github.com/users/poster983/events{/privacy}","received_events_url":"https://api.github.com/users/poster983/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/poster983/Passport-Live","description":"This is the next version of Passport; rebuilt in NodeJS","fork":false,"url":"https://api.github.com/repos/poster983/Passport-Live","forks_url":"https://api.github.com/repos/poster983/Passport-Live/forks","keys_url":"https://api.github.com/repos/poster983/Passport-Live/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poster983/Passport-Live/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poster983/Passport-Live/teams","hooks_url":"https://api.github.com/repos/poster983/Passport-Live/hooks","issue_events_url":"https://api.github.com/repos/poster983/Passport-Live/issues/events{/number}","events_url":"https://api.github.com/repos/poster983/Passport-Live/events","assignees_url":"https://api.github.com/repos/poster983/Passport-Live/assignees{/user}","branches_url":"https://api.github.com/repos/poster983/Passport-Live/branches{/branch}","tags_url":"https://api.github.com/repos/poster983/Passport-Live/tags","blobs_url":"https://api.github.com/repos/poster983/Passport-Live/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poster983/Passport-Live/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poster983/Passport-Live/git/refs{/sha}","trees_url":"https://api.github.com/repos/poster983/Passport-Live/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poster983/Passport-Live/statuses/{sha}","languages_url":"https://api.github.com/repos/poster983/Passport-Live/languages","stargazers_url":"https://api.github.com/repos/poster983/Passport-Live/stargazers","contributors_url":"https://api.github.com/repos/poster983/Passport-Live/contributors","subscribers_url":"https://api.github.com/repos/poster983/Passport-Live/subscribers","subscription_url":"https://api.github.com/repos/poster983/Passport-Live/subscription","commits_url":"https://api.github.com/repos/poster983/Passport-Live/commits{/sha}","git_commits_url":"https://api.github.com/repos/poster983/Passport-Live/git/commits{/sha}","comments_url":"https://api.github.com/repos/poster983/Passport-Live/comments{/number}","issue_comment_url":"https://api.github.com/repos/poster983/Passport-Live/issues/comments{/number}","contents_url":"https://api.github.com/repos/poster983/Passport-Live/contents/{+path}","compare_url":"https://api.github.com/repos/poster983/Passport-Live/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poster983/Passport-Live/merges","archive_url":"https://api.github.com/repos/poster983/Passport-Live/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poster983/Passport-Live/downloads","issues_url":"https://api.github.com/repos/poster983/Passport-Live/issues{/number}","pulls_url":"https://api.github.com/repos/poster983/Passport-Live/pulls{/number}","milestones_url":"https://api.github.com/repos/poster983/Passport-Live/milestones{/number}","notifications_url":"https://api.github.com/repos/poster983/Passport-Live/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poster983/Passport-Live/labels{/name}","releases_url":"https://api.github.com/repos/poster983/Passport-Live/releases{/id}","deployments_url":"https://api.github.com/repos/poster983/Passport-Live/deployments","created_at":"2017-03-01T22:53:43Z","updated_at":"2017-07-11T04:58:20Z","pushed_at":"2017-07-11T21:26:18Z","git_url":"git://github.com/poster983/Passport-Live.git","ssh_url":"git@github.com:poster983/Passport-Live.git","clone_url":"https://github.com/poster983/Passport-Live.git","svn_url":"https://github.com/poster983/Passport-Live","homepage":null,"size":8913,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":1,"default_branch":"master"}},"base":{"label":"poster983:master","ref":"master","sha":"33b84a1f2b376b8b3be7511c7203518f1c41dff5","user":{"login":"poster983","id":6720066,"avatar_url":"https://avatars1.githubusercontent.com/u/6720066?v=3","gravatar_id":"","url":"https://api.github.com/users/poster983","html_url":"https://github.com/poster983","followers_url":"https://api.github.com/users/poster983/followers","following_url":"https://api.github.com/users/poster983/following{/other_user}","gists_url":"https://api.github.com/users/poster983/gists{/gist_id}","starred_url":"https://api.github.com/users/poster983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poster983/subscriptions","organizations_url":"https://api.github.com/users/poster983/orgs","repos_url":"https://api.github.com/users/poster983/repos","events_url":"https://api.github.com/users/poster983/events{/privacy}","received_events_url":"https://api.github.com/users/poster983/received_events","type":"User","site_admin":false},"repo":{"id":83609990,"name":"Passport-Live","full_name":"poster983/Passport-Live","owner":{"login":"poster983","id":6720066,"avatar_url":"https://avatars1.githubusercontent.com/u/6720066?v=3","gravatar_id":"","url":"https://api.github.com/users/poster983","html_url":"https://github.com/poster983","followers_url":"https://api.github.com/users/poster983/followers","following_url":"https://api.github.com/users/poster983/following{/other_user}","gists_url":"https://api.github.com/users/poster983/gists{/gist_id}","starred_url":"https://api.github.com/users/poster983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poster983/subscriptions","organizations_url":"https://api.github.com/users/poster983/orgs","repos_url":"https://api.github.com/users/poster983/repos","events_url":"https://api.github.com/users/poster983/events{/privacy}","received_events_url":"https://api.github.com/users/poster983/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/poster983/Passport-Live","description":"This is the next version of Passport; rebuilt in NodeJS","fork":false,"url":"https://api.github.com/repos/poster983/Passport-Live","forks_url":"https://api.github.com/repos/poster983/Passport-Live/forks","keys_url":"https://api.github.com/repos/poster983/Passport-Live/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poster983/Passport-Live/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poster983/Passport-Live/teams","hooks_url":"https://api.github.com/repos/poster983/Passport-Live/hooks","issue_events_url":"https://api.github.com/repos/poster983/Passport-Live/issues/events{/number}","events_url":"https://api.github.com/repos/poster983/Passport-Live/events","assignees_url":"https://api.github.com/repos/poster983/Passport-Live/assignees{/user}","branches_url":"https://api.github.com/repos/poster983/Passport-Live/branches{/branch}","tags_url":"https://api.github.com/repos/poster983/Passport-Live/tags","blobs_url":"https://api.github.com/repos/poster983/Passport-Live/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poster983/Passport-Live/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poster983/Passport-Live/git/refs{/sha}","trees_url":"https://api.github.com/repos/poster983/Passport-Live/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poster983/Passport-Live/statuses/{sha}","languages_url":"https://api.github.com/repos/poster983/Passport-Live/languages","stargazers_url":"https://api.github.com/repos/poster983/Passport-Live/stargazers","contributors_url":"https://api.github.com/repos/poster983/Passport-Live/contributors","subscribers_url":"https://api.github.com/repos/poster983/Passport-Live/subscribers","subscription_url":"https://api.github.com/repos/poster983/Passport-Live/subscription","commits_url":"https://api.github.com/repos/poster983/Passport-Live/commits{/sha}","git_commits_url":"https://api.github.com/repos/poster983/Passport-Live/git/commits{/sha}","comments_url":"https://api.github.com/repos/poster983/Passport-Live/comments{/number}","issue_comment_url":"https://api.github.com/repos/poster983/Passport-Live/issues/comments{/number}","contents_url":"https://api.github.com/repos/poster983/Passport-Live/contents/{+path}","compare_url":"https://api.github.com/repos/poster983/Passport-Live/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poster983/Passport-Live/merges","archive_url":"https://api.github.com/repos/poster983/Passport-Live/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poster983/Passport-Live/downloads","issues_url":"https://api.github.com/repos/poster983/Passport-Live/issues{/number}","pulls_url":"https://api.github.com/repos/poster983/Passport-Live/pulls{/number}","milestones_url":"https://api.github.com/repos/poster983/Passport-Live/milestones{/number}","notifications_url":"https://api.github.com/repos/poster983/Passport-Live/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poster983/Passport-Live/labels{/name}","releases_url":"https://api.github.com/repos/poster983/Passport-Live/releases{/id}","deployments_url":"https://api.github.com/repos/poster983/Passport-Live/deployments","created_at":"2017-03-01T22:53:43Z","updated_at":"2017-07-11T04:58:20Z","pushed_at":"2017-07-11T21:26:18Z","git_url":"git://github.com/poster983/Passport-Live.git","ssh_url":"git@github.com:poster983/Passport-Live.git","clone_url":"https://github.com/poster983/Passport-Live.git","svn_url":"https://github.com/poster983/Passport-Live","homepage":null,"size":8913,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/40"},"html":{"href":"https://github.com/poster983/Passport-Live/pull/40"},"issue":{"href":"https://api.github.com/repos/poster983/Passport-Live/issues/40"},"comments":{"href":"https://api.github.com/repos/poster983/Passport-Live/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poster983/Passport-Live/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/poster983/Passport-Live/statuses/a50add2209c3a470db27523da77104102814e543"}}}}
{"actor":{"display_login":"codacy-bot"}}