{"action":"created","comment":{"url":"https://api.github.com/repos/18F/midas/pulls/comments/31049749","id":31049749,"diff_hunk":"@@ -237,7 +238,12 @@ module.exports = {\n     if (!target || target === '' || !_.contains(sails.config.auth.config.oauth, target)) {\n       return res.send(403, { message: \"Unsupported OAuth method.\" });\n     }\n-    var config = sails.config.auth.config.config;\n+    var config = sails.config.auth.config.config,\n+        path = req.headers.referer.split('://')[1].split(req.headers.host)[1];","path":"api/controllers/AuthController.js","position":16,"original_position":16,"commit_id":"b589afbfb89fb1597f1d1fffcb86285922b204da","original_commit_id":"b589afbfb89fb1597f1d1fffcb86285922b204da","user":{"login":"dhcole","id":170641,"avatar_url":"https://avatars.githubusercontent.com/u/170641?v=3","gravatar_id":"","url":"https://api.github.com/users/dhcole","html_url":"https://github.com/dhcole","followers_url":"https://api.github.com/users/dhcole/followers","following_url":"https://api.github.com/users/dhcole/following{/other_user}","gists_url":"https://api.github.com/users/dhcole/gists{/gist_id}","starred_url":"https://api.github.com/users/dhcole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhcole/subscriptions","organizations_url":"https://api.github.com/users/dhcole/orgs","repos_url":"https://api.github.com/users/dhcole/repos","events_url":"https://api.github.com/users/dhcole/events{/privacy}","received_events_url":"https://api.github.com/users/dhcole/received_events","type":"User","site_admin":false},"body":"I don't think there could be a different host than the host header... We need to find the referring header instead of the request path, because we need the source page, not the API call to authenticate.\r\n\r\nDo you know of another way to handle this?","created_at":"2015-05-26T15:58:36Z","updated_at":"2015-05-26T15:58:36Z","html_url":"https://github.com/18F/midas/pull/810#discussion_r31049749","pull_request_url":"https://api.github.com/repos/18F/midas/pulls/810","_links":{"self":{"href":"https://api.github.com/repos/18F/midas/pulls/comments/31049749"},"html":{"href":"https://github.com/18F/midas/pull/810#discussion_r31049749"},"pull_request":{"href":"https://api.github.com/repos/18F/midas/pulls/810"}}},"pull_request":{"url":"https://api.github.com/repos/18F/midas/pulls/810","id":36074862,"html_url":"https://github.com/18F/midas/pull/810","diff_url":"https://github.com/18F/midas/pull/810.diff","patch_url":"https://github.com/18F/midas/pull/810.patch","issue_url":"https://api.github.com/repos/18F/midas/issues/810","number":810,"state":"open","locked":false,"title":"Redirect to referring url after oauth login","user":{"login":"dhcole","id":170641,"avatar_url":"https://avatars.githubusercontent.com/u/170641?v=3","gravatar_id":"","url":"https://api.github.com/users/dhcole","html_url":"https://github.com/dhcole","followers_url":"https://api.github.com/users/dhcole/followers","following_url":"https://api.github.com/users/dhcole/following{/other_user}","gists_url":"https://api.github.com/users/dhcole/gists{/gist_id}","starred_url":"https://api.github.com/users/dhcole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhcole/subscriptions","organizations_url":"https://api.github.com/users/dhcole/orgs","repos_url":"https://api.github.com/users/dhcole/repos","events_url":"https://api.github.com/users/dhcole/events{/privacy}","received_events_url":"https://api.github.com/users/dhcole/received_events","type":"User","site_admin":false},"body":"This PR redirects the user to the referring url after logging in with an oauth account. This addresses the issue where logging into the `/people` page redirected away.\r\n\r\nIt also changes the way the volunteer modal is triggered after log-in so that it works with oauth accounts.\r\n\r\nCloses #724 \r\n\r\n","created_at":"2015-05-22T22:46:59Z","updated_at":"2015-05-26T15:58:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efc4e7bd4f04702f481f6eae200379584c071cd6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/midas/pulls/810/commits","review_comments_url":"https://api.github.com/repos/18F/midas/pulls/810/comments","review_comment_url":"https://api.github.com/repos/18F/midas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/midas/issues/810/comments","statuses_url":"https://api.github.com/repos/18F/midas/statuses/b589afbfb89fb1597f1d1fffcb86285922b204da","head":{"label":"18F:issue-724","ref":"issue-724","sha":"b589afbfb89fb1597f1d1fffcb86285922b204da","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":11452644,"name":"midas","full_name":"18F/midas","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/midas","description":"Innovation platform and collaboration marketplace","fork":false,"url":"https://api.github.com/repos/18F/midas","forks_url":"https://api.github.com/repos/18F/midas/forks","keys_url":"https://api.github.com/repos/18F/midas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/midas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/midas/teams","hooks_url":"https://api.github.com/repos/18F/midas/hooks","issue_events_url":"https://api.github.com/repos/18F/midas/issues/events{/number}","events_url":"https://api.github.com/repos/18F/midas/events","assignees_url":"https://api.github.com/repos/18F/midas/assignees{/user}","branches_url":"https://api.github.com/repos/18F/midas/branches{/branch}","tags_url":"https://api.github.com/repos/18F/midas/tags","blobs_url":"https://api.github.com/repos/18F/midas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/midas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/midas/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/midas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/midas/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/midas/languages","stargazers_url":"https://api.github.com/repos/18F/midas/stargazers","contributors_url":"https://api.github.com/repos/18F/midas/contributors","subscribers_url":"https://api.github.com/repos/18F/midas/subscribers","subscription_url":"https://api.github.com/repos/18F/midas/subscription","commits_url":"https://api.github.com/repos/18F/midas/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/midas/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/midas/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/midas/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/midas/contents/{+path}","compare_url":"https://api.github.com/repos/18F/midas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/midas/merges","archive_url":"https://api.github.com/repos/18F/midas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/midas/downloads","issues_url":"https://api.github.com/repos/18F/midas/issues{/number}","pulls_url":"https://api.github.com/repos/18F/midas/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/midas/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/midas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/midas/labels{/name}","releases_url":"https://api.github.com/repos/18F/midas/releases{/id}","created_at":"2013-07-16T15:11:10Z","updated_at":"2015-05-21T20:34:13Z","pushed_at":"2015-05-22T22:46:59Z","git_url":"git://github.com/18F/midas.git","ssh_url":"git@github.com:18F/midas.git","clone_url":"https://github.com/18F/midas.git","svn_url":"https://github.com/18F/midas","homepage":"https://midas-dev.18f.us/","size":45059,"stargazers_count":111,"watchers_count":111,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":69,"mirror_url":null,"open_issues_count":91,"forks":69,"open_issues":91,"watchers":111,"default_branch":"devel"}},"base":{"label":"18F:devel","ref":"devel","sha":"eb1a1a7a1d2b7abc37188936d458353c12dce7f1","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":11452644,"name":"midas","full_name":"18F/midas","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/midas","description":"Innovation platform and collaboration marketplace","fork":false,"url":"https://api.github.com/repos/18F/midas","forks_url":"https://api.github.com/repos/18F/midas/forks","keys_url":"https://api.github.com/repos/18F/midas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/midas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/midas/teams","hooks_url":"https://api.github.com/repos/18F/midas/hooks","issue_events_url":"https://api.github.com/repos/18F/midas/issues/events{/number}","events_url":"https://api.github.com/repos/18F/midas/events","assignees_url":"https://api.github.com/repos/18F/midas/assignees{/user}","branches_url":"https://api.github.com/repos/18F/midas/branches{/branch}","tags_url":"https://api.github.com/repos/18F/midas/tags","blobs_url":"https://api.github.com/repos/18F/midas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/midas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/midas/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/midas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/midas/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/midas/languages","stargazers_url":"https://api.github.com/repos/18F/midas/stargazers","contributors_url":"https://api.github.com/repos/18F/midas/contributors","subscribers_url":"https://api.github.com/repos/18F/midas/subscribers","subscription_url":"https://api.github.com/repos/18F/midas/subscription","commits_url":"https://api.github.com/repos/18F/midas/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/midas/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/midas/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/midas/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/midas/contents/{+path}","compare_url":"https://api.github.com/repos/18F/midas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/midas/merges","archive_url":"https://api.github.com/repos/18F/midas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/midas/downloads","issues_url":"https://api.github.com/repos/18F/midas/issues{/number}","pulls_url":"https://api.github.com/repos/18F/midas/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/midas/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/midas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/midas/labels{/name}","releases_url":"https://api.github.com/repos/18F/midas/releases{/id}","created_at":"2013-07-16T15:11:10Z","updated_at":"2015-05-21T20:34:13Z","pushed_at":"2015-05-22T22:46:59Z","git_url":"git://github.com/18F/midas.git","ssh_url":"git@github.com:18F/midas.git","clone_url":"https://github.com/18F/midas.git","svn_url":"https://github.com/18F/midas","homepage":"https://midas-dev.18f.us/","size":45059,"stargazers_count":111,"watchers_count":111,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":69,"mirror_url":null,"open_issues_count":91,"forks":69,"open_issues":91,"watchers":111,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/midas/pulls/810"},"html":{"href":"https://github.com/18F/midas/pull/810"},"issue":{"href":"https://api.github.com/repos/18F/midas/issues/810"},"comments":{"href":"https://api.github.com/repos/18F/midas/issues/810/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/midas/pulls/810/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/midas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/midas/pulls/810/commits"},"statuses":{"href":"https://api.github.com/repos/18F/midas/statuses/b589afbfb89fb1597f1d1fffcb86285922b204da"}}}}