{"action":"created","comment":{"url":"https://api.github.com/repos/Moniarchy/food/pulls/comments/151003221","pull_request_review_id":76641442,"id":151003221,"diff_hunk":"@@ -3,19 +3,18 @@ const router = express.Router()\n \n const { User } = require( '../database' )\n \n-router.post( '/sign-up', (request, response) => {\n+router.post( '/sign-up', ( request, response ) => {\n   const { username, email, password, lat, long } = request.body\n \n-  // TODO: If user exists, return\n   User.signUp({ username, email, password, lat, long })\n-    .then( user => response.status(201).json( user ))\n-    .catch( error => response.status(500).json({ error: error.message  }))\n+    .then( user => response.status( 201 ).json( user ))\n+    .catch( error => response.status( 500 ).json({ error: \"The email or username you entered were already taken.\" }))\n })\n \n-router.post( '/login', (request, response) => {\n+router.post( '/login', ( request, response ) => {\n   User.login( request.body )\n-    .then( user => response.cookie( 'user_id', user.id ).status(200).json( user ))\n-    .catch( error => response.status(500).json({ error: error.message }))\n+    .then( user => response.cookie( 'user_id', user.id ).status( 200 ).json( user ))","path":"server/routes/users.js","position":21,"original_position":21,"commit_id":"81e4db211a0a74aa049cd3f869f506750551e196","original_commit_id":"81e4db211a0a74aa049cd3f869f506750551e196","user":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"body":"Great question. JRob wrote this as a start to auth. I'm going to explore using the express-session module.","created_at":"2017-11-15T00:18:33Z","updated_at":"2017-11-15T00:18:33Z","html_url":"https://github.com/Moniarchy/food/pull/3#discussion_r151003221","pull_request_url":"https://api.github.com/repos/Moniarchy/food/pulls/3","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/comments/151003221"},"html":{"href":"https://github.com/Moniarchy/food/pull/3#discussion_r151003221"},"pull_request":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/3"}},"in_reply_to_id":150990191},"pull_request":{"url":"https://api.github.com/repos/Moniarchy/food/pulls/3","id":152162348,"html_url":"https://github.com/Moniarchy/food/pull/3","diff_url":"https://github.com/Moniarchy/food/pull/3.diff","patch_url":"https://github.com/Moniarchy/food/pull/3.patch","issue_url":"https://api.github.com/repos/Moniarchy/food/issues/3","number":3,"state":"open","locked":false,"title":"Bolster auth","user":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-13T06:38:32Z","updated_at":"2017-11-15T00:18:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e8f65ff70a07714cb1bf476b93a0bd2c59ea184","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Moniarchy/food/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Moniarchy/food/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Moniarchy/food/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Moniarchy/food/issues/3/comments","statuses_url":"https://api.github.com/repos/Moniarchy/food/statuses/81e4db211a0a74aa049cd3f869f506750551e196","head":{"label":"Moniarchy:bolster-auth","ref":"bolster-auth","sha":"81e4db211a0a74aa049cd3f869f506750551e196","user":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"repo":{"id":104272992,"name":"food","full_name":"Moniarchy/food","owner":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Moniarchy/food","description":"Food I said","fork":true,"url":"https://api.github.com/repos/Moniarchy/food","forks_url":"https://api.github.com/repos/Moniarchy/food/forks","keys_url":"https://api.github.com/repos/Moniarchy/food/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Moniarchy/food/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Moniarchy/food/teams","hooks_url":"https://api.github.com/repos/Moniarchy/food/hooks","issue_events_url":"https://api.github.com/repos/Moniarchy/food/issues/events{/number}","events_url":"https://api.github.com/repos/Moniarchy/food/events","assignees_url":"https://api.github.com/repos/Moniarchy/food/assignees{/user}","branches_url":"https://api.github.com/repos/Moniarchy/food/branches{/branch}","tags_url":"https://api.github.com/repos/Moniarchy/food/tags","blobs_url":"https://api.github.com/repos/Moniarchy/food/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Moniarchy/food/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Moniarchy/food/git/refs{/sha}","trees_url":"https://api.github.com/repos/Moniarchy/food/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Moniarchy/food/statuses/{sha}","languages_url":"https://api.github.com/repos/Moniarchy/food/languages","stargazers_url":"https://api.github.com/repos/Moniarchy/food/stargazers","contributors_url":"https://api.github.com/repos/Moniarchy/food/contributors","subscribers_url":"https://api.github.com/repos/Moniarchy/food/subscribers","subscription_url":"https://api.github.com/repos/Moniarchy/food/subscription","commits_url":"https://api.github.com/repos/Moniarchy/food/commits{/sha}","git_commits_url":"https://api.github.com/repos/Moniarchy/food/git/commits{/sha}","comments_url":"https://api.github.com/repos/Moniarchy/food/comments{/number}","issue_comment_url":"https://api.github.com/repos/Moniarchy/food/issues/comments{/number}","contents_url":"https://api.github.com/repos/Moniarchy/food/contents/{+path}","compare_url":"https://api.github.com/repos/Moniarchy/food/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Moniarchy/food/merges","archive_url":"https://api.github.com/repos/Moniarchy/food/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Moniarchy/food/downloads","issues_url":"https://api.github.com/repos/Moniarchy/food/issues{/number}","pulls_url":"https://api.github.com/repos/Moniarchy/food/pulls{/number}","milestones_url":"https://api.github.com/repos/Moniarchy/food/milestones{/number}","notifications_url":"https://api.github.com/repos/Moniarchy/food/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Moniarchy/food/labels{/name}","releases_url":"https://api.github.com/repos/Moniarchy/food/releases{/id}","deployments_url":"https://api.github.com/repos/Moniarchy/food/deployments","created_at":"2017-09-20T22:15:16Z","updated_at":"2017-09-20T22:15:17Z","pushed_at":"2017-11-13T18:57:31Z","git_url":"git://github.com/Moniarchy/food.git","ssh_url":"git@github.com:Moniarchy/food.git","clone_url":"https://github.com/Moniarchy/food.git","svn_url":"https://github.com/Moniarchy/food","homepage":null,"size":41,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Moniarchy:master","ref":"master","sha":"98d87fba54a47c4a7e738827ecb12e8148c00f54","user":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"repo":{"id":104272992,"name":"food","full_name":"Moniarchy/food","owner":{"login":"Moniarchy","id":18104615,"avatar_url":"https://avatars1.githubusercontent.com/u/18104615?v=4","gravatar_id":"","url":"https://api.github.com/users/Moniarchy","html_url":"https://github.com/Moniarchy","followers_url":"https://api.github.com/users/Moniarchy/followers","following_url":"https://api.github.com/users/Moniarchy/following{/other_user}","gists_url":"https://api.github.com/users/Moniarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/Moniarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moniarchy/subscriptions","organizations_url":"https://api.github.com/users/Moniarchy/orgs","repos_url":"https://api.github.com/users/Moniarchy/repos","events_url":"https://api.github.com/users/Moniarchy/events{/privacy}","received_events_url":"https://api.github.com/users/Moniarchy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Moniarchy/food","description":"Food I said","fork":true,"url":"https://api.github.com/repos/Moniarchy/food","forks_url":"https://api.github.com/repos/Moniarchy/food/forks","keys_url":"https://api.github.com/repos/Moniarchy/food/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Moniarchy/food/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Moniarchy/food/teams","hooks_url":"https://api.github.com/repos/Moniarchy/food/hooks","issue_events_url":"https://api.github.com/repos/Moniarchy/food/issues/events{/number}","events_url":"https://api.github.com/repos/Moniarchy/food/events","assignees_url":"https://api.github.com/repos/Moniarchy/food/assignees{/user}","branches_url":"https://api.github.com/repos/Moniarchy/food/branches{/branch}","tags_url":"https://api.github.com/repos/Moniarchy/food/tags","blobs_url":"https://api.github.com/repos/Moniarchy/food/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Moniarchy/food/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Moniarchy/food/git/refs{/sha}","trees_url":"https://api.github.com/repos/Moniarchy/food/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Moniarchy/food/statuses/{sha}","languages_url":"https://api.github.com/repos/Moniarchy/food/languages","stargazers_url":"https://api.github.com/repos/Moniarchy/food/stargazers","contributors_url":"https://api.github.com/repos/Moniarchy/food/contributors","subscribers_url":"https://api.github.com/repos/Moniarchy/food/subscribers","subscription_url":"https://api.github.com/repos/Moniarchy/food/subscription","commits_url":"https://api.github.com/repos/Moniarchy/food/commits{/sha}","git_commits_url":"https://api.github.com/repos/Moniarchy/food/git/commits{/sha}","comments_url":"https://api.github.com/repos/Moniarchy/food/comments{/number}","issue_comment_url":"https://api.github.com/repos/Moniarchy/food/issues/comments{/number}","contents_url":"https://api.github.com/repos/Moniarchy/food/contents/{+path}","compare_url":"https://api.github.com/repos/Moniarchy/food/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Moniarchy/food/merges","archive_url":"https://api.github.com/repos/Moniarchy/food/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Moniarchy/food/downloads","issues_url":"https://api.github.com/repos/Moniarchy/food/issues{/number}","pulls_url":"https://api.github.com/repos/Moniarchy/food/pulls{/number}","milestones_url":"https://api.github.com/repos/Moniarchy/food/milestones{/number}","notifications_url":"https://api.github.com/repos/Moniarchy/food/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Moniarchy/food/labels{/name}","releases_url":"https://api.github.com/repos/Moniarchy/food/releases{/id}","deployments_url":"https://api.github.com/repos/Moniarchy/food/deployments","created_at":"2017-09-20T22:15:16Z","updated_at":"2017-09-20T22:15:17Z","pushed_at":"2017-11-13T18:57:31Z","git_url":"git://github.com/Moniarchy/food.git","ssh_url":"git@github.com:Moniarchy/food.git","clone_url":"https://github.com/Moniarchy/food.git","svn_url":"https://github.com/Moniarchy/food","homepage":null,"size":41,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/3"},"html":{"href":"https://github.com/Moniarchy/food/pull/3"},"issue":{"href":"https://api.github.com/repos/Moniarchy/food/issues/3"},"comments":{"href":"https://api.github.com/repos/Moniarchy/food/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Moniarchy/food/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Moniarchy/food/statuses/81e4db211a0a74aa049cd3f869f506750551e196"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Moniarchy"}}