{"action":"closed","number":233,"pull_request":{"url":"https://api.github.com/repos/osumb/challenges/pulls/233","id":93224021,"html_url":"https://github.com/osumb/challenges/pull/233","diff_url":"https://github.com/osumb/challenges/pull/233.diff","patch_url":"https://github.com/osumb/challenges/pull/233.patch","issue_url":"https://api.github.com/repos/osumb/challenges/issues/233","number":233,"state":"closed","locked":false,"title":"React cleanup","user":{"login":"atareshawty","id":3112926,"avatar_url":"https://avatars.githubusercontent.com/u/3112926?v=3","gravatar_id":"","url":"https://api.github.com/users/atareshawty","html_url":"https://github.com/atareshawty","followers_url":"https://api.github.com/users/atareshawty/followers","following_url":"https://api.github.com/users/atareshawty/following{/other_user}","gists_url":"https://api.github.com/users/atareshawty/gists{/gist_id}","starred_url":"https://api.github.com/users/atareshawty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atareshawty/subscriptions","organizations_url":"https://api.github.com/users/atareshawty/orgs","repos_url":"https://api.github.com/users/atareshawty/repos","events_url":"https://api.github.com/users/atareshawty/events{/privacy}","received_events_url":"https://api.github.com/users/atareshawty/received_events","type":"User","site_admin":false},"body":"Alright, there's a bunch of stuff going on here... Sorry, self.\r\n\r\nFirst off, auth has changed a little. Tokens can now expire, and revoked (but no on an individual level). On every successful request, a token gets sent with an updated expires date. Rather than send a new token in every controller function, I added middleware in `app.js` that sends the token along with the json response.\r\n\r\nThe flow is as follows:\r\n\r\n- Request is received by server\r\n- Token is checked for expiration/revocation\r\n    - If successful, new token is attached to `res.locals.token`, `next()` is called\r\n- Router gets request and chooses the correct controller action\r\n- Controller gets request and does whatever it needs to do. Attaches it's response to `res.locals.jsonResp` and calls `next()`\r\n- Final middleware at `/api` actually calls `res.json()` with `res.locals.token` and `res.locals.jsonResp`\r\n\r\nI added password resetting.\r\n\r\nThat flow is as follows:\r\n\r\n- User heads to `/forgotPassword`\r\n- Enters name.# and email to send password reset\r\n- Request is made and if successful, the user will be sent a unique link with some hashed id associated with the request\r\n- They'll enter a new password (twice) and be sent back to login when successful.\r\n- **After a password is reset, all tokens associated with the user will no longer be valid. That's handled on the `revoke_token_date` user field**\r\n\r\nFor some reason, an `ApiWrapper` component was added in this PR. It takes care of the `componentDidMount` logic in components that fetch data on mount\r\n\r\nFor some reason, I wanted to add more pain to this PR, so I revised the `canChallengeForPerformance` query so it's more accurate\r\n\r\n","created_at":"2016-11-10T20:24:01Z","updated_at":"2016-11-16T13:54:15Z","closed_at":"2016-11-16T13:54:15Z","merged_at":"2016-11-16T13:54:15Z","merge_commit_sha":"c34e7cc8e18df80817831cfb93477c96c9bc5798","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/osumb/challenges/pulls/233/commits","review_comments_url":"https://api.github.com/repos/osumb/challenges/pulls/233/comments","review_comment_url":"https://api.github.com/repos/osumb/challenges/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osumb/challenges/issues/233/comments","statuses_url":"https://api.github.com/repos/osumb/challenges/statuses/0def2d8a5178c69dc4bba6b03ffb1f5ce4565736","head":{"label":"osumb:react-cleanup","ref":"react-cleanup","sha":"0def2d8a5178c69dc4bba6b03ffb1f5ce4565736","user":{"login":"osumb","id":7408198,"avatar_url":"https://avatars.githubusercontent.com/u/7408198?v=3","gravatar_id":"","url":"https://api.github.com/users/osumb","html_url":"https://github.com/osumb","followers_url":"https://api.github.com/users/osumb/followers","following_url":"https://api.github.com/users/osumb/following{/other_user}","gists_url":"https://api.github.com/users/osumb/gists{/gist_id}","starred_url":"https://api.github.com/users/osumb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osumb/subscriptions","organizations_url":"https://api.github.com/users/osumb/orgs","repos_url":"https://api.github.com/users/osumb/repos","events_url":"https://api.github.com/users/osumb/events{/privacy}","received_events_url":"https://api.github.com/users/osumb/received_events","type":"Organization","site_admin":false},"repo":{"id":53875441,"name":"challenges","full_name":"osumb/challenges","owner":{"login":"osumb","id":7408198,"avatar_url":"https://avatars.githubusercontent.com/u/7408198?v=3","gravatar_id":"","url":"https://api.github.com/users/osumb","html_url":"https://github.com/osumb","followers_url":"https://api.github.com/users/osumb/followers","following_url":"https://api.github.com/users/osumb/following{/other_user}","gists_url":"https://api.github.com/users/osumb/gists{/gist_id}","starred_url":"https://api.github.com/users/osumb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osumb/subscriptions","organizations_url":"https://api.github.com/users/osumb/orgs","repos_url":"https://api.github.com/users/osumb/repos","events_url":"https://api.github.com/users/osumb/events{/privacy}","received_events_url":"https://api.github.com/users/osumb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osumb/challenges","description":"Challenge Signup Manager","fork":false,"url":"https://api.github.com/repos/osumb/challenges","forks_url":"https://api.github.com/repos/osumb/challenges/forks","keys_url":"https://api.github.com/repos/osumb/challenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osumb/challenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osumb/challenges/teams","hooks_url":"https://api.github.com/repos/osumb/challenges/hooks","issue_events_url":"https://api.github.com/repos/osumb/challenges/issues/events{/number}","events_url":"https://api.github.com/repos/osumb/challenges/events","assignees_url":"https://api.github.com/repos/osumb/challenges/assignees{/user}","branches_url":"https://api.github.com/repos/osumb/challenges/branches{/branch}","tags_url":"https://api.github.com/repos/osumb/challenges/tags","blobs_url":"https://api.github.com/repos/osumb/challenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osumb/challenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osumb/challenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/osumb/challenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osumb/challenges/statuses/{sha}","languages_url":"https://api.github.com/repos/osumb/challenges/languages","stargazers_url":"https://api.github.com/repos/osumb/challenges/stargazers","contributors_url":"https://api.github.com/repos/osumb/challenges/contributors","subscribers_url":"https://api.github.com/repos/osumb/challenges/subscribers","subscription_url":"https://api.github.com/repos/osumb/challenges/subscription","commits_url":"https://api.github.com/repos/osumb/challenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/osumb/challenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/osumb/challenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/osumb/challenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/osumb/challenges/contents/{+path}","compare_url":"https://api.github.com/repos/osumb/challenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osumb/challenges/merges","archive_url":"https://api.github.com/repos/osumb/challenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osumb/challenges/downloads","issues_url":"https://api.github.com/repos/osumb/challenges/issues{/number}","pulls_url":"https://api.github.com/repos/osumb/challenges/pulls{/number}","milestones_url":"https://api.github.com/repos/osumb/challenges/milestones{/number}","notifications_url":"https://api.github.com/repos/osumb/challenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osumb/challenges/labels{/name}","releases_url":"https://api.github.com/repos/osumb/challenges/releases{/id}","deployments_url":"https://api.github.com/repos/osumb/challenges/deployments","created_at":"2016-03-14T17:07:36Z","updated_at":"2016-09-08T18:35:03Z","pushed_at":"2016-11-16T13:54:15Z","git_url":"git://github.com/osumb/challenges.git","ssh_url":"git@github.com:osumb/challenges.git","clone_url":"https://github.com/osumb/challenges.git","svn_url":"https://github.com/osumb/challenges","homepage":"http://osumbchallenges.herokuapp.com","size":2301,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":25,"forks":3,"open_issues":25,"watchers":2,"default_branch":"master"}},"base":{"label":"osumb:react-base","ref":"react-base","sha":"8d657aee1642dc8c30d123cfd52cb5d1c79ff097","user":{"login":"osumb","id":7408198,"avatar_url":"https://avatars.githubusercontent.com/u/7408198?v=3","gravatar_id":"","url":"https://api.github.com/users/osumb","html_url":"https://github.com/osumb","followers_url":"https://api.github.com/users/osumb/followers","following_url":"https://api.github.com/users/osumb/following{/other_user}","gists_url":"https://api.github.com/users/osumb/gists{/gist_id}","starred_url":"https://api.github.com/users/osumb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osumb/subscriptions","organizations_url":"https://api.github.com/users/osumb/orgs","repos_url":"https://api.github.com/users/osumb/repos","events_url":"https://api.github.com/users/osumb/events{/privacy}","received_events_url":"https://api.github.com/users/osumb/received_events","type":"Organization","site_admin":false},"repo":{"id":53875441,"name":"challenges","full_name":"osumb/challenges","owner":{"login":"osumb","id":7408198,"avatar_url":"https://avatars.githubusercontent.com/u/7408198?v=3","gravatar_id":"","url":"https://api.github.com/users/osumb","html_url":"https://github.com/osumb","followers_url":"https://api.github.com/users/osumb/followers","following_url":"https://api.github.com/users/osumb/following{/other_user}","gists_url":"https://api.github.com/users/osumb/gists{/gist_id}","starred_url":"https://api.github.com/users/osumb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osumb/subscriptions","organizations_url":"https://api.github.com/users/osumb/orgs","repos_url":"https://api.github.com/users/osumb/repos","events_url":"https://api.github.com/users/osumb/events{/privacy}","received_events_url":"https://api.github.com/users/osumb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osumb/challenges","description":"Challenge Signup Manager","fork":false,"url":"https://api.github.com/repos/osumb/challenges","forks_url":"https://api.github.com/repos/osumb/challenges/forks","keys_url":"https://api.github.com/repos/osumb/challenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osumb/challenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osumb/challenges/teams","hooks_url":"https://api.github.com/repos/osumb/challenges/hooks","issue_events_url":"https://api.github.com/repos/osumb/challenges/issues/events{/number}","events_url":"https://api.github.com/repos/osumb/challenges/events","assignees_url":"https://api.github.com/repos/osumb/challenges/assignees{/user}","branches_url":"https://api.github.com/repos/osumb/challenges/branches{/branch}","tags_url":"https://api.github.com/repos/osumb/challenges/tags","blobs_url":"https://api.github.com/repos/osumb/challenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osumb/challenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osumb/challenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/osumb/challenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osumb/challenges/statuses/{sha}","languages_url":"https://api.github.com/repos/osumb/challenges/languages","stargazers_url":"https://api.github.com/repos/osumb/challenges/stargazers","contributors_url":"https://api.github.com/repos/osumb/challenges/contributors","subscribers_url":"https://api.github.com/repos/osumb/challenges/subscribers","subscription_url":"https://api.github.com/repos/osumb/challenges/subscription","commits_url":"https://api.github.com/repos/osumb/challenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/osumb/challenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/osumb/challenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/osumb/challenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/osumb/challenges/contents/{+path}","compare_url":"https://api.github.com/repos/osumb/challenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osumb/challenges/merges","archive_url":"https://api.github.com/repos/osumb/challenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osumb/challenges/downloads","issues_url":"https://api.github.com/repos/osumb/challenges/issues{/number}","pulls_url":"https://api.github.com/repos/osumb/challenges/pulls{/number}","milestones_url":"https://api.github.com/repos/osumb/challenges/milestones{/number}","notifications_url":"https://api.github.com/repos/osumb/challenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osumb/challenges/labels{/name}","releases_url":"https://api.github.com/repos/osumb/challenges/releases{/id}","deployments_url":"https://api.github.com/repos/osumb/challenges/deployments","created_at":"2016-03-14T17:07:36Z","updated_at":"2016-09-08T18:35:03Z","pushed_at":"2016-11-16T13:54:15Z","git_url":"git://github.com/osumb/challenges.git","ssh_url":"git@github.com:osumb/challenges.git","clone_url":"https://github.com/osumb/challenges.git","svn_url":"https://github.com/osumb/challenges","homepage":"http://osumbchallenges.herokuapp.com","size":2301,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":25,"forks":3,"open_issues":25,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osumb/challenges/pulls/233"},"html":{"href":"https://github.com/osumb/challenges/pull/233"},"issue":{"href":"https://api.github.com/repos/osumb/challenges/issues/233"},"comments":{"href":"https://api.github.com/repos/osumb/challenges/issues/233/comments"},"review_comments":{"href":"https://api.github.com/repos/osumb/challenges/pulls/233/comments"},"review_comment":{"href":"https://api.github.com/repos/osumb/challenges/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osumb/challenges/pulls/233/commits"},"statuses":{"href":"https://api.github.com/repos/osumb/challenges/statuses/0def2d8a5178c69dc4bba6b03ffb1f5ce4565736"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"atareshawty","id":3112926,"avatar_url":"https://avatars.githubusercontent.com/u/3112926?v=3","gravatar_id":"","url":"https://api.github.com/users/atareshawty","html_url":"https://github.com/atareshawty","followers_url":"https://api.github.com/users/atareshawty/followers","following_url":"https://api.github.com/users/atareshawty/following{/other_user}","gists_url":"https://api.github.com/users/atareshawty/gists{/gist_id}","starred_url":"https://api.github.com/users/atareshawty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atareshawty/subscriptions","organizations_url":"https://api.github.com/users/atareshawty/orgs","repos_url":"https://api.github.com/users/atareshawty/repos","events_url":"https://api.github.com/users/atareshawty/events{/privacy}","received_events_url":"https://api.github.com/users/atareshawty/received_events","type":"User","site_admin":false},"comments":2,"review_comments":7,"commits":41,"additions":934,"deletions":283,"changed_files":38}}
{"actor":{"display_login":"atareshawty"}}