{"action":"closed","number":9919,"pull_request":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919","id":79053727,"html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9919","diff_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9919.diff","patch_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9919.patch","issue_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9919","number":9919,"state":"closed","locked":false,"title":"Show flash message on every page when cheater is logged in","user":{"login":"bugron","id":13225220,"avatar_url":"https://avatars.githubusercontent.com/u/13225220?v=3","gravatar_id":"","url":"https://api.github.com/users/bugron","html_url":"https://github.com/bugron","followers_url":"https://api.github.com/users/bugron/followers","following_url":"https://api.github.com/users/bugron/following{/other_user}","gists_url":"https://api.github.com/users/bugron/gists{/gist_id}","starred_url":"https://api.github.com/users/bugron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugron/subscriptions","organizations_url":"https://api.github.com/users/bugron/orgs","repos_url":"https://api.github.com/users/bugron/repos","events_url":"https://api.github.com/users/bugron/events{/privacy}","received_events_url":"https://api.github.com/users/bugron/received_events","type":"User","site_admin":false},"body":"<!-- FreeCodeCamp Pull Request Template -->\r\n\r\n<!-- IMPORTANT Please review https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/CONTRIBUTING.md for detailed contributing guidelines -->\r\n<!-- Help with PRs can be found at https://gitter.im/FreeCodeCamp/HelpContributors -->\r\n<!-- Make sure that your PR is not a duplicate -->\r\n\r\n#### Pre-Submission Checklist\r\n<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply. -->\r\n<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->\r\n<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] Your pull request targets the `staging` branch of FreeCodeCamp.\r\n- [x] Branch starts with either `fix/`, `feature/`, or `translate/` (e.g. `fix/signin-issue`)\r\n- [x] You have only one commit (if not, [squash](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Git-Squash) them into one commit).\r\n- [x] All new and existing tests pass the command `npm run test-challenges`. Use `git commit --amend` to amend any fixes.\r\n\r\n#### Type of Change\r\n<!-- What type of change does your code introduce? After creating the PR, tick the checkboxes that apply. -->\r\n- [ ] Small bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds new functionality)\r\n- [ ] Breaking change (fix or feature that would change existing functionality)\r\n- [ ] Add new translation (feature adding new translations)\r\n\r\n#### Checklist:\r\n<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply. -->\r\n<!-- If you're unsure about any of these, don't hesitate to ask in the Help Contributors room linked above. We're here to help! -->\r\n- [x] Tested changes locally.\r\n- [x] Closes currently open issue (replace XXXX with an issue no): Closes #9905\r\n\r\n#### Description\r\n<!-- Describe your changes in detail -->\r\nHere is a brief explanation of the code:\r\n`ALLOWED_METHODS`: we only care about `GET`, this is an array in case we want to add other methods. Can be replaced by a string if you want.\r\n`EXCLUDED_PATHS`: All those are excluded so we don't flash anything. We hit `/api/flyers/findOne` on every page request and this is excluded as well as `/challenges/current-challenge` because those will lead to duplicate flash messages. `/signout` is excluded to not to show a flash message after a cheater logs out.\r\n`req.url !== '/'` is immediately after `req.user` because when a user is logged in `/` redirects to `/challenges/current-challenge` and that redirects to the current challenge. So we get three `GET` requests and thus three flash messages.\r\nBelow are some screenshots:\r\n**Cheaters profile page, cheater is not logged in.**\r\n![](http://i.prntscr.com/10d215f97e494585a362b1d57a80ed8b.png)\r\n**Immediately after cheater logged in.**\r\n![](http://i.prntscr.com/57345127e2ee4afeacab18695d807362.png)\r\n**Page `About`**\r\n![](http://i.prntscr.com/79194101b11f4615b60072e6129a6510.png)\r\n**Page `Shop`**\r\n![](http://i.prntscr.com/1f70a8dcd6064ea6b49b9253f6c242e0.png)\r\n**Cheaters profile page, cheater is logged in.**\r\n![](http://i.prntscr.com/1e9cf3eac6464efabddaf78e9e688198.png)\r\nAnd the same for `Commit` page, setting page and so on.","created_at":"2016-07-27T16:16:29Z","updated_at":"2016-07-28T15:13:43Z","closed_at":"2016-07-28T15:13:43Z","merged_at":"2016-07-28T15:13:42Z","merge_commit_sha":"efb0c1161bbfcafb54bf9d42042d1d277b1883ed","assignee":{"login":"raisedadead","id":1884376,"avatar_url":"https://avatars.githubusercontent.com/u/1884376?v=3","gravatar_id":"","url":"https://api.github.com/users/raisedadead","html_url":"https://github.com/raisedadead","followers_url":"https://api.github.com/users/raisedadead/followers","following_url":"https://api.github.com/users/raisedadead/following{/other_user}","gists_url":"https://api.github.com/users/raisedadead/gists{/gist_id}","starred_url":"https://api.github.com/users/raisedadead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raisedadead/subscriptions","organizations_url":"https://api.github.com/users/raisedadead/orgs","repos_url":"https://api.github.com/users/raisedadead/repos","events_url":"https://api.github.com/users/raisedadead/events{/privacy}","received_events_url":"https://api.github.com/users/raisedadead/received_events","type":"User","site_admin":false},"assignees":[{"login":"raisedadead","id":1884376,"avatar_url":"https://avatars.githubusercontent.com/u/1884376?v=3","gravatar_id":"","url":"https://api.github.com/users/raisedadead","html_url":"https://github.com/raisedadead","followers_url":"https://api.github.com/users/raisedadead/followers","following_url":"https://api.github.com/users/raisedadead/following{/other_user}","gists_url":"https://api.github.com/users/raisedadead/gists{/gist_id}","starred_url":"https://api.github.com/users/raisedadead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raisedadead/subscriptions","organizations_url":"https://api.github.com/users/raisedadead/orgs","repos_url":"https://api.github.com/users/raisedadead/repos","events_url":"https://api.github.com/users/raisedadead/events{/privacy}","received_events_url":"https://api.github.com/users/raisedadead/received_events","type":"User","site_admin":false},{"login":"BerkeleyTrue","id":6775919,"avatar_url":"https://avatars.githubusercontent.com/u/6775919?v=3","gravatar_id":"","url":"https://api.github.com/users/BerkeleyTrue","html_url":"https://github.com/BerkeleyTrue","followers_url":"https://api.github.com/users/BerkeleyTrue/followers","following_url":"https://api.github.com/users/BerkeleyTrue/following{/other_user}","gists_url":"https://api.github.com/users/BerkeleyTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/BerkeleyTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BerkeleyTrue/subscriptions","organizations_url":"https://api.github.com/users/BerkeleyTrue/orgs","repos_url":"https://api.github.com/users/BerkeleyTrue/repos","events_url":"https://api.github.com/users/BerkeleyTrue/events{/privacy}","received_events_url":"https://api.github.com/users/BerkeleyTrue/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919/commits","review_comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919/comments","review_comment_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9919/comments","statuses_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/statuses/510ce1fe83f4bcc4f7bdc676700b78834ce93b76","head":{"label":"bugron:feature/flash-cheater-everywhere","ref":"feature/flash-cheater-everywhere","sha":"510ce1fe83f4bcc4f7bdc676700b78834ce93b76","user":{"login":"bugron","id":13225220,"avatar_url":"https://avatars.githubusercontent.com/u/13225220?v=3","gravatar_id":"","url":"https://api.github.com/users/bugron","html_url":"https://github.com/bugron","followers_url":"https://api.github.com/users/bugron/followers","following_url":"https://api.github.com/users/bugron/following{/other_user}","gists_url":"https://api.github.com/users/bugron/gists{/gist_id}","starred_url":"https://api.github.com/users/bugron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugron/subscriptions","organizations_url":"https://api.github.com/users/bugron/orgs","repos_url":"https://api.github.com/users/bugron/repos","events_url":"https://api.github.com/users/bugron/events{/privacy}","received_events_url":"https://api.github.com/users/bugron/received_events","type":"User","site_admin":false},"repo":{"id":41158407,"name":"FreeCodeCamp","full_name":"bugron/FreeCodeCamp","owner":{"login":"bugron","id":13225220,"avatar_url":"https://avatars.githubusercontent.com/u/13225220?v=3","gravatar_id":"","url":"https://api.github.com/users/bugron","html_url":"https://github.com/bugron","followers_url":"https://api.github.com/users/bugron/followers","following_url":"https://api.github.com/users/bugron/following{/other_user}","gists_url":"https://api.github.com/users/bugron/gists{/gist_id}","starred_url":"https://api.github.com/users/bugron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugron/subscriptions","organizations_url":"https://api.github.com/users/bugron/orgs","repos_url":"https://api.github.com/users/bugron/repos","events_url":"https://api.github.com/users/bugron/events{/privacy}","received_events_url":"https://api.github.com/users/bugron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bugron/FreeCodeCamp","description":"The http://FreeCodeCamp.com open-source codebase and curriculum. Practice coding by helping nonprofits.","fork":true,"url":"https://api.github.com/repos/bugron/FreeCodeCamp","forks_url":"https://api.github.com/repos/bugron/FreeCodeCamp/forks","keys_url":"https://api.github.com/repos/bugron/FreeCodeCamp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bugron/FreeCodeCamp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bugron/FreeCodeCamp/teams","hooks_url":"https://api.github.com/repos/bugron/FreeCodeCamp/hooks","issue_events_url":"https://api.github.com/repos/bugron/FreeCodeCamp/issues/events{/number}","events_url":"https://api.github.com/repos/bugron/FreeCodeCamp/events","assignees_url":"https://api.github.com/repos/bugron/FreeCodeCamp/assignees{/user}","branches_url":"https://api.github.com/repos/bugron/FreeCodeCamp/branches{/branch}","tags_url":"https://api.github.com/repos/bugron/FreeCodeCamp/tags","blobs_url":"https://api.github.com/repos/bugron/FreeCodeCamp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bugron/FreeCodeCamp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bugron/FreeCodeCamp/git/refs{/sha}","trees_url":"https://api.github.com/repos/bugron/FreeCodeCamp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bugron/FreeCodeCamp/statuses/{sha}","languages_url":"https://api.github.com/repos/bugron/FreeCodeCamp/languages","stargazers_url":"https://api.github.com/repos/bugron/FreeCodeCamp/stargazers","contributors_url":"https://api.github.com/repos/bugron/FreeCodeCamp/contributors","subscribers_url":"https://api.github.com/repos/bugron/FreeCodeCamp/subscribers","subscription_url":"https://api.github.com/repos/bugron/FreeCodeCamp/subscription","commits_url":"https://api.github.com/repos/bugron/FreeCodeCamp/commits{/sha}","git_commits_url":"https://api.github.com/repos/bugron/FreeCodeCamp/git/commits{/sha}","comments_url":"https://api.github.com/repos/bugron/FreeCodeCamp/comments{/number}","issue_comment_url":"https://api.github.com/repos/bugron/FreeCodeCamp/issues/comments{/number}","contents_url":"https://api.github.com/repos/bugron/FreeCodeCamp/contents/{+path}","compare_url":"https://api.github.com/repos/bugron/FreeCodeCamp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bugron/FreeCodeCamp/merges","archive_url":"https://api.github.com/repos/bugron/FreeCodeCamp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bugron/FreeCodeCamp/downloads","issues_url":"https://api.github.com/repos/bugron/FreeCodeCamp/issues{/number}","pulls_url":"https://api.github.com/repos/bugron/FreeCodeCamp/pulls{/number}","milestones_url":"https://api.github.com/repos/bugron/FreeCodeCamp/milestones{/number}","notifications_url":"https://api.github.com/repos/bugron/FreeCodeCamp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bugron/FreeCodeCamp/labels{/name}","releases_url":"https://api.github.com/repos/bugron/FreeCodeCamp/releases{/id}","deployments_url":"https://api.github.com/repos/bugron/FreeCodeCamp/deployments","created_at":"2015-08-21T13:51:46Z","updated_at":"2016-01-11T18:33:03Z","pushed_at":"2016-07-28T13:33:21Z","git_url":"git://github.com/bugron/FreeCodeCamp.git","ssh_url":"git@github.com:bugron/FreeCodeCamp.git","clone_url":"https://github.com/bugron/FreeCodeCamp.git","svn_url":"https://github.com/bugron/FreeCodeCamp","homepage":"","size":24850,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"FreeCodeCamp:staging","ref":"staging","sha":"8e163b8960f73b71d9978556e4d94a9c0579e15c","user":{"login":"FreeCodeCamp","id":9892522,"avatar_url":"https://avatars.githubusercontent.com/u/9892522?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeCodeCamp","html_url":"https://github.com/FreeCodeCamp","followers_url":"https://api.github.com/users/FreeCodeCamp/followers","following_url":"https://api.github.com/users/FreeCodeCamp/following{/other_user}","gists_url":"https://api.github.com/users/FreeCodeCamp/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeCodeCamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeCodeCamp/subscriptions","organizations_url":"https://api.github.com/users/FreeCodeCamp/orgs","repos_url":"https://api.github.com/users/FreeCodeCamp/repos","events_url":"https://api.github.com/users/FreeCodeCamp/events{/privacy}","received_events_url":"https://api.github.com/users/FreeCodeCamp/received_events","type":"Organization","site_admin":false},"repo":{"id":28457823,"name":"FreeCodeCamp","full_name":"FreeCodeCamp/FreeCodeCamp","owner":{"login":"FreeCodeCamp","id":9892522,"avatar_url":"https://avatars.githubusercontent.com/u/9892522?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeCodeCamp","html_url":"https://github.com/FreeCodeCamp","followers_url":"https://api.github.com/users/FreeCodeCamp/followers","following_url":"https://api.github.com/users/FreeCodeCamp/following{/other_user}","gists_url":"https://api.github.com/users/FreeCodeCamp/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeCodeCamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeCodeCamp/subscriptions","organizations_url":"https://api.github.com/users/FreeCodeCamp/orgs","repos_url":"https://api.github.com/users/FreeCodeCamp/repos","events_url":"https://api.github.com/users/FreeCodeCamp/events{/privacy}","received_events_url":"https://api.github.com/users/FreeCodeCamp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp","description":"The https://FreeCodeCamp.com open source codebase and curriculum. Learn to code and help nonprofits.","fork":false,"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp","forks_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/forks","keys_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/teams","hooks_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/hooks","issue_events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/events{/number}","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/events","assignees_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/assignees{/user}","branches_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/branches{/branch}","tags_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/tags","blobs_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/git/refs{/sha}","trees_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/statuses/{sha}","languages_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/languages","stargazers_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/stargazers","contributors_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/contributors","subscribers_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/subscribers","subscription_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/subscription","commits_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/commits{/sha}","git_commits_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/git/commits{/sha}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/comments{/number}","issue_comment_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/comments{/number}","contents_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/contents/{+path}","compare_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/merges","archive_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/downloads","issues_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues{/number}","pulls_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls{/number}","milestones_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/milestones{/number}","notifications_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/labels{/name}","releases_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/releases{/id}","deployments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/deployments","created_at":"2014-12-24T17:49:19Z","updated_at":"2016-07-28T15:12:24Z","pushed_at":"2016-07-28T15:13:42Z","git_url":"git://github.com/FreeCodeCamp/FreeCodeCamp.git","ssh_url":"git@github.com:FreeCodeCamp/FreeCodeCamp.git","clone_url":"https://github.com/FreeCodeCamp/FreeCodeCamp.git","svn_url":"https://github.com/FreeCodeCamp/FreeCodeCamp","homepage":"","size":39687,"stargazers_count":158957,"watchers_count":158957,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5652,"mirror_url":null,"open_issues_count":354,"forks":5652,"open_issues":354,"watchers":158957,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919"},"html":{"href":"https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9919"},"issue":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9919"},"comments":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9919/comments"},"review_comments":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919/comments"},"review_comment":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/pulls/9919/commits"},"statuses":{"href":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/statuses/510ce1fe83f4bcc4f7bdc676700b78834ce93b76"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"raisedadead","id":1884376,"avatar_url":"https://avatars.githubusercontent.com/u/1884376?v=3","gravatar_id":"","url":"https://api.github.com/users/raisedadead","html_url":"https://github.com/raisedadead","followers_url":"https://api.github.com/users/raisedadead/followers","following_url":"https://api.github.com/users/raisedadead/following{/other_user}","gists_url":"https://api.github.com/users/raisedadead/gists{/gist_id}","starred_url":"https://api.github.com/users/raisedadead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raisedadead/subscriptions","organizations_url":"https://api.github.com/users/raisedadead/orgs","repos_url":"https://api.github.com/users/raisedadead/repos","events_url":"https://api.github.com/users/raisedadead/events{/privacy}","received_events_url":"https://api.github.com/users/raisedadead/received_events","type":"User","site_admin":false},"comments":10,"review_comments":0,"commits":1,"additions":32,"deletions":2,"changed_files":3}}
{"actor":{"display_login":"raisedadead"}}