{"action":"created","comment":{"url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/comments/63440895","id":63440895,"diff_hunk":"@@ -0,0 +1,55 @@\n+var helper = require('./helper.js')\n+var jwt = require('jsonwebtoken')\n+var router = require('express').Router()\n+\n+router.post('/schools/signin', function (req, res) {\n+  var generateToken = jwt.sign({\n+    name: req.body.name,\n+    password: req.body.password\n+  }, process.env.TOKEN_SECRET)\n+\n+  console.log(req.body.name)\n+\n+  helper.getSchoolName(req.body.name).then(function (nameResp) {\n+    console.log('nameResp ', nameResp)\n+    console.log(nameResp.length)\n+    if (nameResp.length === 0) {\n+      res.json({success: false}).status(500)\n+    } else {\n+      helper.getSchoolPassword(req.body.name).then(function (resp) {\n+        if (req.body.password === resp[0]['password']) {\n+          console.log('resp at 0', resp[0])\n+          res.json({success: true, generateToken: generateToken}).status(201)\n+        } else {\n+          res.json({success: false}).status(500)\n+        }\n+      })\n+    }\n+  })\n+})\n+\n+router.post('/signin', function (req, res) {\n+  var generateToken = jwt.sign({\n+    email: req.body.email,\n+    password: req.body.password,\n+    phonenum: req.body.phone,\n+    name: req.body.name,\n+    school: req.body.school\n+  }, process.env.TOKEN_SECRET)","path":"server/routes/signin.js","position":38,"original_position":38,"commit_id":"5b0cf4b5f83245008751842784f009363f23001f","original_commit_id":"5b0cf4b5f83245008751842784f009363f23001f","user":{"login":"merktassel","id":10404365,"avatar_url":"https://avatars.githubusercontent.com/u/10404365?v=3","gravatar_id":"","url":"https://api.github.com/users/merktassel","html_url":"https://github.com/merktassel","followers_url":"https://api.github.com/users/merktassel/followers","following_url":"https://api.github.com/users/merktassel/following{/other_user}","gists_url":"https://api.github.com/users/merktassel/gists{/gist_id}","starred_url":"https://api.github.com/users/merktassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merktassel/subscriptions","organizations_url":"https://api.github.com/users/merktassel/orgs","repos_url":"https://api.github.com/users/merktassel/repos","events_url":"https://api.github.com/users/merktassel/events{/privacy}","received_events_url":"https://api.github.com/users/merktassel/received_events","type":"User","site_admin":false},"body":"Make sure everyone is aware of this new environment variable.","created_at":"2016-05-16T23:03:50Z","updated_at":"2016-05-16T23:03:50Z","html_url":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68#discussion_r63440895","pull_request_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/comments/63440895"},"html":{"href":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68#discussion_r63440895"},"pull_request":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68","id":70273260,"html_url":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68","diff_url":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68.diff","patch_url":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68.patch","issue_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/68","number":68,"state":"open","locked":false,"title":"Implement Authentication","user":{"login":"dainkang1","id":8535056,"avatar_url":"https://avatars.githubusercontent.com/u/8535056?v=3","gravatar_id":"","url":"https://api.github.com/users/dainkang1","html_url":"https://github.com/dainkang1","followers_url":"https://api.github.com/users/dainkang1/followers","following_url":"https://api.github.com/users/dainkang1/following{/other_user}","gists_url":"https://api.github.com/users/dainkang1/gists{/gist_id}","starred_url":"https://api.github.com/users/dainkang1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dainkang1/subscriptions","organizations_url":"https://api.github.com/users/dainkang1/orgs","repos_url":"https://api.github.com/users/dainkang1/repos","events_url":"https://api.github.com/users/dainkang1/events{/privacy}","received_events_url":"https://api.github.com/users/dainkang1/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-16T22:35:57Z","updated_at":"2016-05-16T23:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21914b976b932ac4849e3426d2f6392aeca118b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68/commits","review_comments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68/comments","review_comment_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/68/comments","statuses_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/statuses/5b0cf4b5f83245008751842784f009363f23001f","head":{"label":"MKS-Elixr:implement-authentication","ref":"implement-authentication","sha":"5b0cf4b5f83245008751842784f009363f23001f","user":{"login":"MKS-Elixr","id":18689305,"avatar_url":"https://avatars.githubusercontent.com/u/18689305?v=3","gravatar_id":"","url":"https://api.github.com/users/MKS-Elixr","html_url":"https://github.com/MKS-Elixr","followers_url":"https://api.github.com/users/MKS-Elixr/followers","following_url":"https://api.github.com/users/MKS-Elixr/following{/other_user}","gists_url":"https://api.github.com/users/MKS-Elixr/gists{/gist_id}","starred_url":"https://api.github.com/users/MKS-Elixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKS-Elixr/subscriptions","organizations_url":"https://api.github.com/users/MKS-Elixr/orgs","repos_url":"https://api.github.com/users/MKS-Elixr/repos","events_url":"https://api.github.com/users/MKS-Elixr/events{/privacy}","received_events_url":"https://api.github.com/users/MKS-Elixr/received_events","type":"Organization","site_admin":false},"repo":{"id":57167595,"name":"jubilant-umbrella","full_name":"MKS-Elixr/jubilant-umbrella","owner":{"login":"MKS-Elixr","id":18689305,"avatar_url":"https://avatars.githubusercontent.com/u/18689305?v=3","gravatar_id":"","url":"https://api.github.com/users/MKS-Elixr","html_url":"https://github.com/MKS-Elixr","followers_url":"https://api.github.com/users/MKS-Elixr/followers","following_url":"https://api.github.com/users/MKS-Elixr/following{/other_user}","gists_url":"https://api.github.com/users/MKS-Elixr/gists{/gist_id}","starred_url":"https://api.github.com/users/MKS-Elixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKS-Elixr/subscriptions","organizations_url":"https://api.github.com/users/MKS-Elixr/orgs","repos_url":"https://api.github.com/users/MKS-Elixr/repos","events_url":"https://api.github.com/users/MKS-Elixr/events{/privacy}","received_events_url":"https://api.github.com/users/MKS-Elixr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MKS-Elixr/jubilant-umbrella","description":"","fork":false,"url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella","forks_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/forks","keys_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/teams","hooks_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/hooks","issue_events_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/events{/number}","events_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/events","assignees_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/assignees{/user}","branches_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/branches{/branch}","tags_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/tags","blobs_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/refs{/sha}","trees_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/statuses/{sha}","languages_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/languages","stargazers_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/stargazers","contributors_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/contributors","subscribers_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/subscribers","subscription_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/subscription","commits_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/commits{/sha}","git_commits_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/commits{/sha}","comments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/comments{/number}","issue_comment_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/comments{/number}","contents_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/contents/{+path}","compare_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/merges","archive_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/downloads","issues_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues{/number}","pulls_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls{/number}","milestones_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/milestones{/number}","notifications_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/labels{/name}","releases_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/releases{/id}","deployments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/deployments","created_at":"2016-04-26T22:59:26Z","updated_at":"2016-04-28T19:13:43Z","pushed_at":"2016-05-16T23:01:43Z","git_url":"git://github.com/MKS-Elixr/jubilant-umbrella.git","ssh_url":"git@github.com:MKS-Elixr/jubilant-umbrella.git","clone_url":"https://github.com/MKS-Elixr/jubilant-umbrella.git","svn_url":"https://github.com/MKS-Elixr/jubilant-umbrella","homepage":null,"size":811,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":0,"default_branch":"master"}},"base":{"label":"MKS-Elixr:master","ref":"master","sha":"f1f3ac26993aff13530d936cd3f499195c94f31a","user":{"login":"MKS-Elixr","id":18689305,"avatar_url":"https://avatars.githubusercontent.com/u/18689305?v=3","gravatar_id":"","url":"https://api.github.com/users/MKS-Elixr","html_url":"https://github.com/MKS-Elixr","followers_url":"https://api.github.com/users/MKS-Elixr/followers","following_url":"https://api.github.com/users/MKS-Elixr/following{/other_user}","gists_url":"https://api.github.com/users/MKS-Elixr/gists{/gist_id}","starred_url":"https://api.github.com/users/MKS-Elixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKS-Elixr/subscriptions","organizations_url":"https://api.github.com/users/MKS-Elixr/orgs","repos_url":"https://api.github.com/users/MKS-Elixr/repos","events_url":"https://api.github.com/users/MKS-Elixr/events{/privacy}","received_events_url":"https://api.github.com/users/MKS-Elixr/received_events","type":"Organization","site_admin":false},"repo":{"id":57167595,"name":"jubilant-umbrella","full_name":"MKS-Elixr/jubilant-umbrella","owner":{"login":"MKS-Elixr","id":18689305,"avatar_url":"https://avatars.githubusercontent.com/u/18689305?v=3","gravatar_id":"","url":"https://api.github.com/users/MKS-Elixr","html_url":"https://github.com/MKS-Elixr","followers_url":"https://api.github.com/users/MKS-Elixr/followers","following_url":"https://api.github.com/users/MKS-Elixr/following{/other_user}","gists_url":"https://api.github.com/users/MKS-Elixr/gists{/gist_id}","starred_url":"https://api.github.com/users/MKS-Elixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKS-Elixr/subscriptions","organizations_url":"https://api.github.com/users/MKS-Elixr/orgs","repos_url":"https://api.github.com/users/MKS-Elixr/repos","events_url":"https://api.github.com/users/MKS-Elixr/events{/privacy}","received_events_url":"https://api.github.com/users/MKS-Elixr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MKS-Elixr/jubilant-umbrella","description":"","fork":false,"url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella","forks_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/forks","keys_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/teams","hooks_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/hooks","issue_events_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/events{/number}","events_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/events","assignees_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/assignees{/user}","branches_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/branches{/branch}","tags_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/tags","blobs_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/refs{/sha}","trees_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/statuses/{sha}","languages_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/languages","stargazers_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/stargazers","contributors_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/contributors","subscribers_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/subscribers","subscription_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/subscription","commits_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/commits{/sha}","git_commits_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/git/commits{/sha}","comments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/comments{/number}","issue_comment_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/comments{/number}","contents_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/contents/{+path}","compare_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/merges","archive_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/downloads","issues_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues{/number}","pulls_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls{/number}","milestones_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/milestones{/number}","notifications_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/labels{/name}","releases_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/releases{/id}","deployments_url":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/deployments","created_at":"2016-04-26T22:59:26Z","updated_at":"2016-04-28T19:13:43Z","pushed_at":"2016-05-16T23:01:43Z","git_url":"git://github.com/MKS-Elixr/jubilant-umbrella.git","ssh_url":"git@github.com:MKS-Elixr/jubilant-umbrella.git","clone_url":"https://github.com/MKS-Elixr/jubilant-umbrella.git","svn_url":"https://github.com/MKS-Elixr/jubilant-umbrella","homepage":null,"size":811,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68"},"html":{"href":"https://github.com/MKS-Elixr/jubilant-umbrella/pull/68"},"issue":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/68"},"comments":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/MKS-Elixr/jubilant-umbrella/statuses/5b0cf4b5f83245008751842784f009363f23001f"}}}}