{"action":"created","comment":{"url":"https://api.github.com/repos/ACEof/albums/pulls/comments/201234118","pull_request_review_id":135693644,"id":201234118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTIzNDExOA==","diff_hunk":"@@ -0,0 +1,88 @@\n+const express = require('express');\n+const cookieSession = require('cookie-session');\n+const passport = require('passport');\n+const GoogleStrategy = require('passport-google-oauth2').Strategy;\n+const models = require('./models');\n+const handlebars = require('express-handlebars')\n+  .create({defaultLayout: 'main'});\n+require('dotenv').config();\n+\n+const app = express();\n+\n+app.engine('handlebars', handlebars.engine);\n+app.set('view engine', 'handlebars');\n+\n+app.use(passport.initialize());\n+app.use(passport.session());\n+app.use(cookieSession({\n+  name: process.env.nameSession,\n+  secret: process.env.secretSession,\n+  resave: false,\n+  saveUninitialized: true,\n+  cookie: {\n+    path: '/',\n+    httpOnly: true,\n+    maxAge: 24 * 60 * 60 * 1000\n+  }\n+}));\n+app.use(express.static('static'));\n+\n+passport.serializeUser((user, done) => {\n+  done(null, user);\n+});\n+passport.deserializeUser((user, done) => {\n+  done(null, user);\n+});\n+\n+passport.use(new GoogleStrategy({\n+  clientID: process.env.clientID,\n+  clientSecret: process.env.clientSecret,\n+  callbackURL: process.env.callbackURL\n+},\n+function(accessToken, refreshToken, profile, done) {\n+  return done(null, profile);\n+}));\n+\n+app.get('/albums', (req, res, next) => {\n+  if (req.session.passport) {\n+    return res.render('albums', {name: req.session.passport.user.displayName});\n+    next();\n+  }  \n+  res.redirect('/auth/google');\n+});\n+\n+app.get('/auth/google',\n+  passport.authenticate('google', { successRedirect: '/',scope:\n+    [ 'https://www.googleapis.com/auth/userinfo.email' ] \n+  }));\n+\n+app.get('/auth/google/callback',\n+  passport.authenticate( 'google', {\n+    successRedirect: '/',\n+    failureRedirect: '/auth/google', \n+  }));\n+\n+app.get('/',(req, res, next) => {\n+  if (req.session.passport) {\n+    return res.redirect('/albums');\n+    next();\n+  }\n+  res.render('home');\n+});\n+\n+app.get('/logout',(req, res) => {\n+  req.session = null;\n+  res.redirect('/');\n+});\n+\n+async () => {\n+  try {\n+   const connect = await models.sequelize.sync();\n+  }\n+  catch(err){","path":"index.js","position":82,"original_position":82,"commit_id":"234822277d4719f56db4f6772662eff9be4238c1","original_commit_id":"234822277d4719f56db4f6772662eff9be4238c1","user":{"login":"abtv","id":7084666,"node_id":"MDQ6VXNlcjcwODQ2NjY=","avatar_url":"https://avatars1.githubusercontent.com/u/7084666?v=4","gravatar_id":"","url":"https://api.github.com/users/abtv","html_url":"https://github.com/abtv","followers_url":"https://api.github.com/users/abtv/followers","following_url":"https://api.github.com/users/abtv/following{/other_user}","gists_url":"https://api.github.com/users/abtv/gists{/gist_id}","starred_url":"https://api.github.com/users/abtv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abtv/subscriptions","organizations_url":"https://api.github.com/users/abtv/orgs","repos_url":"https://api.github.com/users/abtv/repos","events_url":"https://api.github.com/users/abtv/events{/privacy}","received_events_url":"https://api.github.com/users/abtv/received_events","type":"User","site_admin":false},"body":"no logging? what is it for?","created_at":"2018-07-10T06:54:36Z","updated_at":"2018-07-10T06:54:36Z","html_url":"https://github.com/ACEof/albums/pull/2#discussion_r201234118","pull_request_url":"https://api.github.com/repos/ACEof/albums/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ACEof/albums/pulls/comments/201234118"},"html":{"href":"https://github.com/ACEof/albums/pull/2#discussion_r201234118"},"pull_request":{"href":"https://api.github.com/repos/ACEof/albums/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/ACEof/albums/pulls/2","id":199985323,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTg1MzIz","html_url":"https://github.com/ACEof/albums/pull/2","diff_url":"https://github.com/ACEof/albums/pull/2.diff","patch_url":"https://github.com/ACEof/albums/pull/2.patch","issue_url":"https://api.github.com/repos/ACEof/albums/issues/2","number":2,"state":"open","locked":false,"title":"Implement login page","user":{"login":"ACEof","id":16652418,"node_id":"MDQ6VXNlcjE2NjUyNDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16652418?v=4","gravatar_id":"","url":"https://api.github.com/users/ACEof","html_url":"https://github.com/ACEof","followers_url":"https://api.github.com/users/ACEof/followers","following_url":"https://api.github.com/users/ACEof/following{/other_user}","gists_url":"https://api.github.com/users/ACEof/gists{/gist_id}","starred_url":"https://api.github.com/users/ACEof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACEof/subscriptions","organizations_url":"https://api.github.com/users/ACEof/orgs","repos_url":"https://api.github.com/users/ACEof/repos","events_url":"https://api.github.com/users/ACEof/events{/privacy}","received_events_url":"https://api.github.com/users/ACEof/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-09T03:49:35Z","updated_at":"2018-07-10T06:54:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbddf082195fc6da68f62a30d06564edc1f50175","assignee":null,"assignees":[],"requested_reviewers":[{"login":"AdmiralJMP1","id":38570141,"node_id":"MDQ6VXNlcjM4NTcwMTQx","avatar_url":"https://avatars2.githubusercontent.com/u/38570141?v=4","gravatar_id":"","url":"https://api.github.com/users/AdmiralJMP1","html_url":"https://github.com/AdmiralJMP1","followers_url":"https://api.github.com/users/AdmiralJMP1/followers","following_url":"https://api.github.com/users/AdmiralJMP1/following{/other_user}","gists_url":"https://api.github.com/users/AdmiralJMP1/gists{/gist_id}","starred_url":"https://api.github.com/users/AdmiralJMP1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdmiralJMP1/subscriptions","organizations_url":"https://api.github.com/users/AdmiralJMP1/orgs","repos_url":"https://api.github.com/users/AdmiralJMP1/repos","events_url":"https://api.github.com/users/AdmiralJMP1/events{/privacy}","received_events_url":"https://api.github.com/users/AdmiralJMP1/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ACEof/albums/pulls/2/commits","review_comments_url":"https://api.github.com/repos/ACEof/albums/pulls/2/comments","review_comment_url":"https://api.github.com/repos/ACEof/albums/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ACEof/albums/issues/2/comments","statuses_url":"https://api.github.com/repos/ACEof/albums/statuses/234822277d4719f56db4f6772662eff9be4238c1","head":{"label":"ACEof:implement-login-page","ref":"implement-login-page","sha":"234822277d4719f56db4f6772662eff9be4238c1","user":{"login":"ACEof","id":16652418,"node_id":"MDQ6VXNlcjE2NjUyNDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16652418?v=4","gravatar_id":"","url":"https://api.github.com/users/ACEof","html_url":"https://github.com/ACEof","followers_url":"https://api.github.com/users/ACEof/followers","following_url":"https://api.github.com/users/ACEof/following{/other_user}","gists_url":"https://api.github.com/users/ACEof/gists{/gist_id}","starred_url":"https://api.github.com/users/ACEof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACEof/subscriptions","organizations_url":"https://api.github.com/users/ACEof/orgs","repos_url":"https://api.github.com/users/ACEof/repos","events_url":"https://api.github.com/users/ACEof/events{/privacy}","received_events_url":"https://api.github.com/users/ACEof/received_events","type":"User","site_admin":false},"repo":{"id":139445518,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk0NDU1MTg=","name":"albums","full_name":"ACEof/albums","owner":{"login":"ACEof","id":16652418,"node_id":"MDQ6VXNlcjE2NjUyNDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16652418?v=4","gravatar_id":"","url":"https://api.github.com/users/ACEof","html_url":"https://github.com/ACEof","followers_url":"https://api.github.com/users/ACEof/followers","following_url":"https://api.github.com/users/ACEof/following{/other_user}","gists_url":"https://api.github.com/users/ACEof/gists{/gist_id}","starred_url":"https://api.github.com/users/ACEof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACEof/subscriptions","organizations_url":"https://api.github.com/users/ACEof/orgs","repos_url":"https://api.github.com/users/ACEof/repos","events_url":"https://api.github.com/users/ACEof/events{/privacy}","received_events_url":"https://api.github.com/users/ACEof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ACEof/albums","description":"An application for storing your photos in one place","fork":false,"url":"https://api.github.com/repos/ACEof/albums","forks_url":"https://api.github.com/repos/ACEof/albums/forks","keys_url":"https://api.github.com/repos/ACEof/albums/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ACEof/albums/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ACEof/albums/teams","hooks_url":"https://api.github.com/repos/ACEof/albums/hooks","issue_events_url":"https://api.github.com/repos/ACEof/albums/issues/events{/number}","events_url":"https://api.github.com/repos/ACEof/albums/events","assignees_url":"https://api.github.com/repos/ACEof/albums/assignees{/user}","branches_url":"https://api.github.com/repos/ACEof/albums/branches{/branch}","tags_url":"https://api.github.com/repos/ACEof/albums/tags","blobs_url":"https://api.github.com/repos/ACEof/albums/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ACEof/albums/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ACEof/albums/git/refs{/sha}","trees_url":"https://api.github.com/repos/ACEof/albums/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ACEof/albums/statuses/{sha}","languages_url":"https://api.github.com/repos/ACEof/albums/languages","stargazers_url":"https://api.github.com/repos/ACEof/albums/stargazers","contributors_url":"https://api.github.com/repos/ACEof/albums/contributors","subscribers_url":"https://api.github.com/repos/ACEof/albums/subscribers","subscription_url":"https://api.github.com/repos/ACEof/albums/subscription","commits_url":"https://api.github.com/repos/ACEof/albums/commits{/sha}","git_commits_url":"https://api.github.com/repos/ACEof/albums/git/commits{/sha}","comments_url":"https://api.github.com/repos/ACEof/albums/comments{/number}","issue_comment_url":"https://api.github.com/repos/ACEof/albums/issues/comments{/number}","contents_url":"https://api.github.com/repos/ACEof/albums/contents/{+path}","compare_url":"https://api.github.com/repos/ACEof/albums/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ACEof/albums/merges","archive_url":"https://api.github.com/repos/ACEof/albums/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ACEof/albums/downloads","issues_url":"https://api.github.com/repos/ACEof/albums/issues{/number}","pulls_url":"https://api.github.com/repos/ACEof/albums/pulls{/number}","milestones_url":"https://api.github.com/repos/ACEof/albums/milestones{/number}","notifications_url":"https://api.github.com/repos/ACEof/albums/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ACEof/albums/labels{/name}","releases_url":"https://api.github.com/repos/ACEof/albums/releases{/id}","deployments_url":"https://api.github.com/repos/ACEof/albums/deployments","created_at":"2018-07-02T13:11:20Z","updated_at":"2018-07-03T03:34:17Z","pushed_at":"2018-07-10T03:54:07Z","git_url":"git://github.com/ACEof/albums.git","ssh_url":"git@github.com:ACEof/albums.git","clone_url":"https://github.com/ACEof/albums.git","svn_url":"https://github.com/ACEof/albums","homepage":"https://my-albums1.herokuapp.com/","size":433,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"ACEof:master","ref":"master","sha":"ea31a5534424727df0595cf874aab31d822c79d4","user":{"login":"ACEof","id":16652418,"node_id":"MDQ6VXNlcjE2NjUyNDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16652418?v=4","gravatar_id":"","url":"https://api.github.com/users/ACEof","html_url":"https://github.com/ACEof","followers_url":"https://api.github.com/users/ACEof/followers","following_url":"https://api.github.com/users/ACEof/following{/other_user}","gists_url":"https://api.github.com/users/ACEof/gists{/gist_id}","starred_url":"https://api.github.com/users/ACEof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACEof/subscriptions","organizations_url":"https://api.github.com/users/ACEof/orgs","repos_url":"https://api.github.com/users/ACEof/repos","events_url":"https://api.github.com/users/ACEof/events{/privacy}","received_events_url":"https://api.github.com/users/ACEof/received_events","type":"User","site_admin":false},"repo":{"id":139445518,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk0NDU1MTg=","name":"albums","full_name":"ACEof/albums","owner":{"login":"ACEof","id":16652418,"node_id":"MDQ6VXNlcjE2NjUyNDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16652418?v=4","gravatar_id":"","url":"https://api.github.com/users/ACEof","html_url":"https://github.com/ACEof","followers_url":"https://api.github.com/users/ACEof/followers","following_url":"https://api.github.com/users/ACEof/following{/other_user}","gists_url":"https://api.github.com/users/ACEof/gists{/gist_id}","starred_url":"https://api.github.com/users/ACEof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACEof/subscriptions","organizations_url":"https://api.github.com/users/ACEof/orgs","repos_url":"https://api.github.com/users/ACEof/repos","events_url":"https://api.github.com/users/ACEof/events{/privacy}","received_events_url":"https://api.github.com/users/ACEof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ACEof/albums","description":"An application for storing your photos in one place","fork":false,"url":"https://api.github.com/repos/ACEof/albums","forks_url":"https://api.github.com/repos/ACEof/albums/forks","keys_url":"https://api.github.com/repos/ACEof/albums/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ACEof/albums/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ACEof/albums/teams","hooks_url":"https://api.github.com/repos/ACEof/albums/hooks","issue_events_url":"https://api.github.com/repos/ACEof/albums/issues/events{/number}","events_url":"https://api.github.com/repos/ACEof/albums/events","assignees_url":"https://api.github.com/repos/ACEof/albums/assignees{/user}","branches_url":"https://api.github.com/repos/ACEof/albums/branches{/branch}","tags_url":"https://api.github.com/repos/ACEof/albums/tags","blobs_url":"https://api.github.com/repos/ACEof/albums/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ACEof/albums/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ACEof/albums/git/refs{/sha}","trees_url":"https://api.github.com/repos/ACEof/albums/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ACEof/albums/statuses/{sha}","languages_url":"https://api.github.com/repos/ACEof/albums/languages","stargazers_url":"https://api.github.com/repos/ACEof/albums/stargazers","contributors_url":"https://api.github.com/repos/ACEof/albums/contributors","subscribers_url":"https://api.github.com/repos/ACEof/albums/subscribers","subscription_url":"https://api.github.com/repos/ACEof/albums/subscription","commits_url":"https://api.github.com/repos/ACEof/albums/commits{/sha}","git_commits_url":"https://api.github.com/repos/ACEof/albums/git/commits{/sha}","comments_url":"https://api.github.com/repos/ACEof/albums/comments{/number}","issue_comment_url":"https://api.github.com/repos/ACEof/albums/issues/comments{/number}","contents_url":"https://api.github.com/repos/ACEof/albums/contents/{+path}","compare_url":"https://api.github.com/repos/ACEof/albums/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ACEof/albums/merges","archive_url":"https://api.github.com/repos/ACEof/albums/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ACEof/albums/downloads","issues_url":"https://api.github.com/repos/ACEof/albums/issues{/number}","pulls_url":"https://api.github.com/repos/ACEof/albums/pulls{/number}","milestones_url":"https://api.github.com/repos/ACEof/albums/milestones{/number}","notifications_url":"https://api.github.com/repos/ACEof/albums/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ACEof/albums/labels{/name}","releases_url":"https://api.github.com/repos/ACEof/albums/releases{/id}","deployments_url":"https://api.github.com/repos/ACEof/albums/deployments","created_at":"2018-07-02T13:11:20Z","updated_at":"2018-07-03T03:34:17Z","pushed_at":"2018-07-10T03:54:07Z","git_url":"git://github.com/ACEof/albums.git","ssh_url":"git@github.com:ACEof/albums.git","clone_url":"https://github.com/ACEof/albums.git","svn_url":"https://github.com/ACEof/albums","homepage":"https://my-albums1.herokuapp.com/","size":433,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ACEof/albums/pulls/2"},"html":{"href":"https://github.com/ACEof/albums/pull/2"},"issue":{"href":"https://api.github.com/repos/ACEof/albums/issues/2"},"comments":{"href":"https://api.github.com/repos/ACEof/albums/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/ACEof/albums/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/ACEof/albums/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ACEof/albums/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/ACEof/albums/statuses/234822277d4719f56db4f6772662eff9be4238c1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"abtv"}}