{"action":"created","comment":{"url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/comments/185284326","pull_request_review_id":116641369,"id":185284326,"diff_hunk":"@@ -50,11 +50,9 @@ class LoginSwitch extends Component {\n       case 'STUDENT':\n         return <StudentPage />\n       default:\n-        // If for some reason, we receive an unknown user type, render the splash page\n-        // TODO: Make an error page that says:\n-        // 'Oops! An error occurred. Try clearing your storage and\n-        // cookies and refreshing the page. If the problem persists, contact ______.'\n-        return <HomePage />\n+        // If for some reason, we receive an unknown user type, throw an error,\n+        // so that the error boundary can catch it and render the error page\n+        throw new Error('Unknown User Type')","path":"frontend/src/shared/components/LoginSwitch.js","position":11,"original_position":11,"commit_id":"eb241b15a862ea294259ccaa3aef13243d3689b4","original_commit_id":"eb241b15a862ea294259ccaa3aef13243d3689b4","user":{"login":"billdybas","id":13719429,"avatar_url":"https://avatars2.githubusercontent.com/u/13719429?v=4","gravatar_id":"","url":"https://api.github.com/users/billdybas","html_url":"https://github.com/billdybas","followers_url":"https://api.github.com/users/billdybas/followers","following_url":"https://api.github.com/users/billdybas/following{/other_user}","gists_url":"https://api.github.com/users/billdybas/gists{/gist_id}","starred_url":"https://api.github.com/users/billdybas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billdybas/subscriptions","organizations_url":"https://api.github.com/users/billdybas/orgs","repos_url":"https://api.github.com/users/billdybas/repos","events_url":"https://api.github.com/users/billdybas/events{/privacy}","received_events_url":"https://api.github.com/users/billdybas/received_events","type":"User","site_admin":false},"body":"I figured out this issue. If you're not signed in, `mapStateToProps` will pass in an `undefined` `user` prop, which causes the default prop for this component to be used, which is `{}`. Our check in `render` is `if (!user)` which is incorrect because an empty object is truthy. The check just needs to be changed to `if (!user.type)`","created_at":"2018-05-01T17:45:22Z","updated_at":"2018-05-01T17:45:22Z","html_url":"https://github.com/abstractionhq/gallery-gateway/pull/281#discussion_r185284326","pull_request_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/comments/185284326"},"html":{"href":"https://github.com/abstractionhq/gallery-gateway/pull/281#discussion_r185284326"},"pull_request":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281"}},"in_reply_to_id":185270090},"pull_request":{"url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281","id":185077879,"html_url":"https://github.com/abstractionhq/gallery-gateway/pull/281","diff_url":"https://github.com/abstractionhq/gallery-gateway/pull/281.diff","patch_url":"https://github.com/abstractionhq/gallery-gateway/pull/281.patch","issue_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/281","number":281,"state":"open","locked":false,"title":"Code Cleanup & Backend Security Best Practices","user":{"login":"billdybas","id":13719429,"avatar_url":"https://avatars2.githubusercontent.com/u/13719429?v=4","gravatar_id":"","url":"https://api.github.com/users/billdybas","html_url":"https://github.com/billdybas","followers_url":"https://api.github.com/users/billdybas/followers","following_url":"https://api.github.com/users/billdybas/following{/other_user}","gists_url":"https://api.github.com/users/billdybas/gists{/gist_id}","starred_url":"https://api.github.com/users/billdybas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billdybas/subscriptions","organizations_url":"https://api.github.com/users/billdybas/orgs","repos_url":"https://api.github.com/users/billdybas/repos","events_url":"https://api.github.com/users/billdybas/events{/privacy}","received_events_url":"https://api.github.com/users/billdybas/received_events","type":"User","site_admin":false},"body":"- Don't show Sequelize warnings\r\n- Update Sequelize Models to v4\r\n- Removing unused code & Adding comments\r\n- Update some outstanding frontend error handling\r\n- Disable X-Powered-By Header\r\n- Disable CORS in production\r\n\r\nThe only thing I'm not 100% on is the CORS change. Because we serve the frontend and backend on the same domain, `gallerygateway.rit.edu`, I don't think we need CORS enabled, but I may be wrong. We would need it for local dev because they're run on different ports.","created_at":"2018-04-30T22:10:01Z","updated_at":"2018-05-01T17:45:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71545d1d4d749cbb9d286c88ffb94822861d130d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"robmcl4","id":884115,"avatar_url":"https://avatars0.githubusercontent.com/u/884115?v=4","gravatar_id":"","url":"https://api.github.com/users/robmcl4","html_url":"https://github.com/robmcl4","followers_url":"https://api.github.com/users/robmcl4/followers","following_url":"https://api.github.com/users/robmcl4/following{/other_user}","gists_url":"https://api.github.com/users/robmcl4/gists{/gist_id}","starred_url":"https://api.github.com/users/robmcl4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robmcl4/subscriptions","organizations_url":"https://api.github.com/users/robmcl4/orgs","repos_url":"https://api.github.com/users/robmcl4/repos","events_url":"https://api.github.com/users/robmcl4/events{/privacy}","received_events_url":"https://api.github.com/users/robmcl4/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281/commits","review_comments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281/comments","review_comment_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/281/comments","statuses_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/statuses/eb241b15a862ea294259ccaa3aef13243d3689b4","head":{"label":"abstractionhq:cleanup","ref":"cleanup","sha":"eb241b15a862ea294259ccaa3aef13243d3689b4","user":{"login":"abstractionhq","id":35471221,"avatar_url":"https://avatars1.githubusercontent.com/u/35471221?v=4","gravatar_id":"","url":"https://api.github.com/users/abstractionhq","html_url":"https://github.com/abstractionhq","followers_url":"https://api.github.com/users/abstractionhq/followers","following_url":"https://api.github.com/users/abstractionhq/following{/other_user}","gists_url":"https://api.github.com/users/abstractionhq/gists{/gist_id}","starred_url":"https://api.github.com/users/abstractionhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abstractionhq/subscriptions","organizations_url":"https://api.github.com/users/abstractionhq/orgs","repos_url":"https://api.github.com/users/abstractionhq/repos","events_url":"https://api.github.com/users/abstractionhq/events{/privacy}","received_events_url":"https://api.github.com/users/abstractionhq/received_events","type":"Organization","site_admin":false},"repo":{"id":103687578,"name":"gallery-gateway","full_name":"abstractionhq/gallery-gateway","owner":{"login":"abstractionhq","id":35471221,"avatar_url":"https://avatars1.githubusercontent.com/u/35471221?v=4","gravatar_id":"","url":"https://api.github.com/users/abstractionhq","html_url":"https://github.com/abstractionhq","followers_url":"https://api.github.com/users/abstractionhq/followers","following_url":"https://api.github.com/users/abstractionhq/following{/other_user}","gists_url":"https://api.github.com/users/abstractionhq/gists{/gist_id}","starred_url":"https://api.github.com/users/abstractionhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abstractionhq/subscriptions","organizations_url":"https://api.github.com/users/abstractionhq/orgs","repos_url":"https://api.github.com/users/abstractionhq/repos","events_url":"https://api.github.com/users/abstractionhq/events{/privacy}","received_events_url":"https://api.github.com/users/abstractionhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/abstractionhq/gallery-gateway","description":"Gallery Review System","fork":false,"url":"https://api.github.com/repos/abstractionhq/gallery-gateway","forks_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/forks","keys_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/teams","hooks_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/hooks","issue_events_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/events","assignees_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/tags","blobs_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/languages","stargazers_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/stargazers","contributors_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/contributors","subscribers_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/subscribers","subscription_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/subscription","commits_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/merges","archive_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/downloads","issues_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/labels{/name}","releases_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/releases{/id}","deployments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/deployments","created_at":"2017-09-15T18:12:46Z","updated_at":"2018-05-01T17:02:12Z","pushed_at":"2018-05-01T17:02:13Z","git_url":"git://github.com/abstractionhq/gallery-gateway.git","ssh_url":"git@github.com:abstractionhq/gallery-gateway.git","clone_url":"https://github.com/abstractionhq/gallery-gateway.git","svn_url":"https://github.com/abstractionhq/gallery-gateway","homepage":"","size":61555,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","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":45,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":45,"watchers":4,"default_branch":"master"}},"base":{"label":"abstractionhq:master","ref":"master","sha":"d1f2a0b0d6fd6faa998712fa088d0154fb42db68","user":{"login":"abstractionhq","id":35471221,"avatar_url":"https://avatars1.githubusercontent.com/u/35471221?v=4","gravatar_id":"","url":"https://api.github.com/users/abstractionhq","html_url":"https://github.com/abstractionhq","followers_url":"https://api.github.com/users/abstractionhq/followers","following_url":"https://api.github.com/users/abstractionhq/following{/other_user}","gists_url":"https://api.github.com/users/abstractionhq/gists{/gist_id}","starred_url":"https://api.github.com/users/abstractionhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abstractionhq/subscriptions","organizations_url":"https://api.github.com/users/abstractionhq/orgs","repos_url":"https://api.github.com/users/abstractionhq/repos","events_url":"https://api.github.com/users/abstractionhq/events{/privacy}","received_events_url":"https://api.github.com/users/abstractionhq/received_events","type":"Organization","site_admin":false},"repo":{"id":103687578,"name":"gallery-gateway","full_name":"abstractionhq/gallery-gateway","owner":{"login":"abstractionhq","id":35471221,"avatar_url":"https://avatars1.githubusercontent.com/u/35471221?v=4","gravatar_id":"","url":"https://api.github.com/users/abstractionhq","html_url":"https://github.com/abstractionhq","followers_url":"https://api.github.com/users/abstractionhq/followers","following_url":"https://api.github.com/users/abstractionhq/following{/other_user}","gists_url":"https://api.github.com/users/abstractionhq/gists{/gist_id}","starred_url":"https://api.github.com/users/abstractionhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abstractionhq/subscriptions","organizations_url":"https://api.github.com/users/abstractionhq/orgs","repos_url":"https://api.github.com/users/abstractionhq/repos","events_url":"https://api.github.com/users/abstractionhq/events{/privacy}","received_events_url":"https://api.github.com/users/abstractionhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/abstractionhq/gallery-gateway","description":"Gallery Review System","fork":false,"url":"https://api.github.com/repos/abstractionhq/gallery-gateway","forks_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/forks","keys_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/teams","hooks_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/hooks","issue_events_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/events","assignees_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/tags","blobs_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/languages","stargazers_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/stargazers","contributors_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/contributors","subscribers_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/subscribers","subscription_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/subscription","commits_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/merges","archive_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/downloads","issues_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/labels{/name}","releases_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/releases{/id}","deployments_url":"https://api.github.com/repos/abstractionhq/gallery-gateway/deployments","created_at":"2017-09-15T18:12:46Z","updated_at":"2018-05-01T17:02:12Z","pushed_at":"2018-05-01T17:02:13Z","git_url":"git://github.com/abstractionhq/gallery-gateway.git","ssh_url":"git@github.com:abstractionhq/gallery-gateway.git","clone_url":"https://github.com/abstractionhq/gallery-gateway.git","svn_url":"https://github.com/abstractionhq/gallery-gateway","homepage":"","size":61555,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","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":45,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":45,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281"},"html":{"href":"https://github.com/abstractionhq/gallery-gateway/pull/281"},"issue":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/281"},"comments":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/abstractionhq/gallery-gateway/statuses/eb241b15a862ea294259ccaa3aef13243d3689b4"}},"author_association":"OWNER"}}
{"actor":{"display_login":"billdybas"}}