{"action":"created","comment":{"url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments/165610229","pull_request_review_id":93578962,"id":165610229,"diff_hunk":"@@ -0,0 +1,24 @@\n+const request = require('request-promise')\n+\n+const config = require('./../../../config')\n+\n+function getAccessToken (oauthCode) {\n+  const options = {\n+    method: 'POST',\n+    url: config.oauth.tokenFetchUrl,","path":"src/apps/oauth/services.js","position":8,"original_position":8,"commit_id":"5983cb7285d3eb4bc854424a1bb959cd455b8442","original_commit_id":"5983cb7285d3eb4bc854424a1bb959cd455b8442","user":{"login":"feedmypixel","id":2305016,"avatar_url":"https://avatars0.githubusercontent.com/u/2305016?v=4","gravatar_id":"","url":"https://api.github.com/users/feedmypixel","html_url":"https://github.com/feedmypixel","followers_url":"https://api.github.com/users/feedmypixel/followers","following_url":"https://api.github.com/users/feedmypixel/following{/other_user}","gists_url":"https://api.github.com/users/feedmypixel/gists{/gist_id}","starred_url":"https://api.github.com/users/feedmypixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedmypixel/subscriptions","organizations_url":"https://api.github.com/users/feedmypixel/orgs","repos_url":"https://api.github.com/users/feedmypixel/repos","events_url":"https://api.github.com/users/feedmypixel/events{/privacy}","received_events_url":"https://api.github.com/users/feedmypixel/received_events","type":"User","site_admin":false},"body":"These are all required for Oauth to work so I don't think `get()` is needed here","created_at":"2018-02-02T10:32:15Z","updated_at":"2018-02-02T10:32:15Z","html_url":"https://github.com/uktrade/data-hub-frontend/pull/1228#discussion_r165610229","pull_request_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments/165610229"},"html":{"href":"https://github.com/uktrade/data-hub-frontend/pull/1228#discussion_r165610229"},"pull_request":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228"}},"in_reply_to_id":165603699},"pull_request":{"url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228","id":166745975,"html_url":"https://github.com/uktrade/data-hub-frontend/pull/1228","diff_url":"https://github.com/uktrade/data-hub-frontend/pull/1228.diff","patch_url":"https://github.com/uktrade/data-hub-frontend/pull/1228.patch","issue_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/1228","number":1228,"state":"open","locked":false,"title":"DH-1467 Refactor/tidy up oauth controller","user":{"login":"feedmypixel","id":2305016,"avatar_url":"https://avatars0.githubusercontent.com/u/2305016?v=4","gravatar_id":"","url":"https://api.github.com/users/feedmypixel","html_url":"https://github.com/feedmypixel","followers_url":"https://api.github.com/users/feedmypixel/followers","following_url":"https://api.github.com/users/feedmypixel/following{/other_user}","gists_url":"https://api.github.com/users/feedmypixel/gists{/gist_id}","starred_url":"https://api.github.com/users/feedmypixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedmypixel/subscriptions","organizations_url":"https://api.github.com/users/feedmypixel/orgs","repos_url":"https://api.github.com/users/feedmypixel/repos","events_url":"https://api.github.com/users/feedmypixel/events{/privacy}","received_events_url":"https://api.github.com/users/feedmypixel/received_events","type":"User","site_admin":false},"body":"This is a bit of work to tidy up the Oauth controller somewhat and split work into a `services.js` file. The tests have also been updated.\r\n\r\nOriginally it sat with #1229, but I have split it out as I'm not sure yet if the work in #1229 is actually needed.\r\n\r\n### Of note\r\nall the logging will be going ocne this fix is confirmed\r\n","created_at":"2018-02-02T08:45:32Z","updated_at":"2018-02-02T10:32:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5891e33b57320014710e76fc980003888389b6a","assignee":{"login":"feedmypixel","id":2305016,"avatar_url":"https://avatars0.githubusercontent.com/u/2305016?v=4","gravatar_id":"","url":"https://api.github.com/users/feedmypixel","html_url":"https://github.com/feedmypixel","followers_url":"https://api.github.com/users/feedmypixel/followers","following_url":"https://api.github.com/users/feedmypixel/following{/other_user}","gists_url":"https://api.github.com/users/feedmypixel/gists{/gist_id}","starred_url":"https://api.github.com/users/feedmypixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedmypixel/subscriptions","organizations_url":"https://api.github.com/users/feedmypixel/orgs","repos_url":"https://api.github.com/users/feedmypixel/repos","events_url":"https://api.github.com/users/feedmypixel/events{/privacy}","received_events_url":"https://api.github.com/users/feedmypixel/received_events","type":"User","site_admin":false},"assignees":[{"login":"feedmypixel","id":2305016,"avatar_url":"https://avatars0.githubusercontent.com/u/2305016?v=4","gravatar_id":"","url":"https://api.github.com/users/feedmypixel","html_url":"https://github.com/feedmypixel","followers_url":"https://api.github.com/users/feedmypixel/followers","following_url":"https://api.github.com/users/feedmypixel/following{/other_user}","gists_url":"https://api.github.com/users/feedmypixel/gists{/gist_id}","starred_url":"https://api.github.com/users/feedmypixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedmypixel/subscriptions","organizations_url":"https://api.github.com/users/feedmypixel/orgs","repos_url":"https://api.github.com/users/feedmypixel/repos","events_url":"https://api.github.com/users/feedmypixel/events{/privacy}","received_events_url":"https://api.github.com/users/feedmypixel/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"ztolley","id":56056,"avatar_url":"https://avatars1.githubusercontent.com/u/56056?v=4","gravatar_id":"","url":"https://api.github.com/users/ztolley","html_url":"https://github.com/ztolley","followers_url":"https://api.github.com/users/ztolley/followers","following_url":"https://api.github.com/users/ztolley/following{/other_user}","gists_url":"https://api.github.com/users/ztolley/gists{/gist_id}","starred_url":"https://api.github.com/users/ztolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztolley/subscriptions","organizations_url":"https://api.github.com/users/ztolley/orgs","repos_url":"https://api.github.com/users/ztolley/repos","events_url":"https://api.github.com/users/ztolley/events{/privacy}","received_events_url":"https://api.github.com/users/ztolley/received_events","type":"User","site_admin":false},{"login":"yeahfro","id":1150417,"avatar_url":"https://avatars0.githubusercontent.com/u/1150417?v=4","gravatar_id":"","url":"https://api.github.com/users/yeahfro","html_url":"https://github.com/yeahfro","followers_url":"https://api.github.com/users/yeahfro/followers","following_url":"https://api.github.com/users/yeahfro/following{/other_user}","gists_url":"https://api.github.com/users/yeahfro/gists{/gist_id}","starred_url":"https://api.github.com/users/yeahfro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeahfro/subscriptions","organizations_url":"https://api.github.com/users/yeahfro/orgs","repos_url":"https://api.github.com/users/yeahfro/repos","events_url":"https://api.github.com/users/yeahfro/events{/privacy}","received_events_url":"https://api.github.com/users/yeahfro/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228/commits","review_comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228/comments","review_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/1228/comments","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/5983cb7285d3eb4bc854424a1bb959cd455b8442","head":{"label":"uktrade:refactor/tidy-up-oauth-controller","ref":"refactor/tidy-up-oauth-controller","sha":"5983cb7285d3eb4bc854424a1bb959cd455b8442","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":83823675,"name":"data-hub-frontend","full_name":"uktrade/data-hub-frontend","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-frontend","description":"The frontend rendering application for Data Hub","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-frontend","forks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-frontend/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-frontend/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-frontend/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-frontend/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-frontend/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/deployments","created_at":"2017-03-03T17:26:35Z","updated_at":"2017-12-06T11:06:00Z","pushed_at":"2018-02-02T08:54:45Z","git_url":"git://github.com/uktrade/data-hub-frontend.git","ssh_url":"git@github.com:uktrade/data-hub-frontend.git","clone_url":"https://github.com/uktrade/data-hub-frontend.git","svn_url":"https://github.com/uktrade/data-hub-frontend","homepage":"","size":4810,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":28,"watchers":0,"default_branch":"develop"}},"base":{"label":"uktrade:develop","ref":"develop","sha":"67b5a65cfc1a0de185a5738deb9b13b806c18072","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":83823675,"name":"data-hub-frontend","full_name":"uktrade/data-hub-frontend","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-frontend","description":"The frontend rendering application for Data Hub","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-frontend","forks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-frontend/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-frontend/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-frontend/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-frontend/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-frontend/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/deployments","created_at":"2017-03-03T17:26:35Z","updated_at":"2017-12-06T11:06:00Z","pushed_at":"2018-02-02T08:54:45Z","git_url":"git://github.com/uktrade/data-hub-frontend.git","ssh_url":"git@github.com:uktrade/data-hub-frontend.git","clone_url":"https://github.com/uktrade/data-hub-frontend.git","svn_url":"https://github.com/uktrade/data-hub-frontend","homepage":"","size":4810,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":28,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228"},"html":{"href":"https://github.com/uktrade/data-hub-frontend/pull/1228"},"issue":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/1228"},"comments":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/1228/comments"},"review_comments":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228/comments"},"review_comment":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/1228/commits"},"statuses":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/5983cb7285d3eb4bc854424a1bb959cd455b8442"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"feedmypixel"}}