{"action":"created","comment":{"url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/comments/77959252","id":77959252,"diff_hunk":"@@ -1,6 +1,7 @@\n var _ = require('lodash');\n var passport = require('passport');\n-var requestify = require('requestify');\n+var request = require('request');","path":"winterfell/controllers/authController.js","position":4,"original_position":4,"commit_id":"3be6a3eeefaf2dceb1076fc7f3e040917fe9f2e9","original_commit_id":"3be6a3eeefaf2dceb1076fc7f3e040917fe9f2e9","user":{"login":"ahsu1230","id":4695528,"avatar_url":"https://avatars.githubusercontent.com/u/4695528?v=3","gravatar_id":"","url":"https://api.github.com/users/ahsu1230","html_url":"https://github.com/ahsu1230","followers_url":"https://api.github.com/users/ahsu1230/followers","following_url":"https://api.github.com/users/ahsu1230/following{/other_user}","gists_url":"https://api.github.com/users/ahsu1230/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsu1230/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsu1230/subscriptions","organizations_url":"https://api.github.com/users/ahsu1230/orgs","repos_url":"https://api.github.com/users/ahsu1230/repos","events_url":"https://api.github.com/users/ahsu1230/events{/privacy}","received_events_url":"https://api.github.com/users/ahsu1230/received_events","type":"User","site_admin":false},"body":"unused here","created_at":"2016-09-08T07:43:55Z","updated_at":"2016-09-08T07:43:55Z","html_url":"https://github.com/bayeshack2016/vetafi/pull/55#discussion_r77959252","pull_request_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/comments/77959252"},"html":{"href":"https://github.com/bayeshack2016/vetafi/pull/55#discussion_r77959252"},"pull_request":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55","id":83061238,"html_url":"https://github.com/bayeshack2016/vetafi/pull/55","diff_url":"https://github.com/bayeshack2016/vetafi/pull/55.diff","patch_url":"https://github.com/bayeshack2016/vetafi/pull/55.patch","issue_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/55","number":55,"state":"open","locked":false,"title":"Feature idme sign up (create new user)","user":{"login":"ahsu1230","id":4695528,"avatar_url":"https://avatars.githubusercontent.com/u/4695528?v=3","gravatar_id":"","url":"https://api.github.com/users/ahsu1230","html_url":"https://github.com/ahsu1230","followers_url":"https://api.github.com/users/ahsu1230/followers","following_url":"https://api.github.com/users/ahsu1230/following{/other_user}","gists_url":"https://api.github.com/users/ahsu1230/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsu1230/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsu1230/subscriptions","organizations_url":"https://api.github.com/users/ahsu1230/orgs","repos_url":"https://api.github.com/users/ahsu1230/repos","events_url":"https://api.github.com/users/ahsu1230/events{/privacy}","received_events_url":"https://api.github.com/users/ahsu1230/received_events","type":"User","site_admin":false},"body":"This PR has the following changes:\r\n\r\n* First off, we now have two Vetafi Applications with ID.Me. One is for prod, and the other is for a local dev sandbox. As such, when we build our app, the correct Id.Me clientId needs to correspond to the prod or dev IdMe application.\r\n* The xhrEnv is more useful now because it contains `clientId` and `redirectUri` which depends on whether we build in dev or release.\r\n* xhrEnv is its own gulptask which will generate a `xhrEnv.js` depending on dev or release. The previous PR related to this actually added both dev and release into the build if you ran it twice (once dev and once release). Manually including the `xhrEnv.js` forces us to always pick only one.\r\n\r\nHere's an explanation of how Id.Me works.\r\n1) When a user clicks a Id.Me button, we redirect them to: `https://api.id.me/oauth/authorize...` Here, they will sign in to their Id.Me account and give Vetafi access to their Id.Me info.\r\n2) After signing in, Id.Me will redirect to our server endpoint: `/auth/link/idme/`. Here, we get this code which we will use to obtain an access token.\r\n3)  We POST query for an access token to here: `https://api.id.me/oauth/token`. If an access token is not acquired by 5 minutes, the code from step2 will expire.\r\n4) Then, once an access token is acquired, we will use it to get some user info. Use a GET request to `https://api.id.me/api/public/v2/attributes.json?access_token=ACCESS_TOKEN`. \r\nThe info we get is the following:\r\n```\r\n{\r\n  \"id\": \"65593b840f5c4b1391fb862561efceab\",\r\n  \"verified\": true,\r\n  \"affiliation\": \"Service Member\",\r\n  \"fname\": null,\r\n  \"lname\": null,\r\n  \"zip\": null,\r\n  \"uuid\": \"65593b840f5c4b1391fb862561efceab\",\r\n  \"email\": \"partner+vetafi_sm_1@id.me\"\r\n}\r\n```\r\nLook here for more info: https://developer.id.me/documentation\r\n\r\n4) From here, if everything is fine and dandy, we will create a new user with the given email, firstname, lastname. Make sure that the social user is added to the user.\r\n5) SocialUser is now a subschema (not its own table). A user will have an array of SocialUsers.\r\n\r\nFor now, this change only deals with creating a new user through Id.Me.\r\nLinking an Id.Me account to an existing user will come in a different change.\r\n\r\nAlso, the test user to use is this:\r\n```\r\npartner+vetafi_sm_1@id.me\r\n2eR7OG5DAcB3\r\n```","created_at":"2016-08-29T08:20:31Z","updated_at":"2016-09-08T07:43:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"326962dc65c4c5986d799d769c83cefa31b5bc0c","assignee":{"login":"qwwqwwq","id":4935495,"avatar_url":"https://avatars.githubusercontent.com/u/4935495?v=3","gravatar_id":"","url":"https://api.github.com/users/qwwqwwq","html_url":"https://github.com/qwwqwwq","followers_url":"https://api.github.com/users/qwwqwwq/followers","following_url":"https://api.github.com/users/qwwqwwq/following{/other_user}","gists_url":"https://api.github.com/users/qwwqwwq/gists{/gist_id}","starred_url":"https://api.github.com/users/qwwqwwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwwqwwq/subscriptions","organizations_url":"https://api.github.com/users/qwwqwwq/orgs","repos_url":"https://api.github.com/users/qwwqwwq/repos","events_url":"https://api.github.com/users/qwwqwwq/events{/privacy}","received_events_url":"https://api.github.com/users/qwwqwwq/received_events","type":"User","site_admin":false},"assignees":[{"login":"qwwqwwq","id":4935495,"avatar_url":"https://avatars.githubusercontent.com/u/4935495?v=3","gravatar_id":"","url":"https://api.github.com/users/qwwqwwq","html_url":"https://github.com/qwwqwwq","followers_url":"https://api.github.com/users/qwwqwwq/followers","following_url":"https://api.github.com/users/qwwqwwq/following{/other_user}","gists_url":"https://api.github.com/users/qwwqwwq/gists{/gist_id}","starred_url":"https://api.github.com/users/qwwqwwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwwqwwq/subscriptions","organizations_url":"https://api.github.com/users/qwwqwwq/orgs","repos_url":"https://api.github.com/users/qwwqwwq/repos","events_url":"https://api.github.com/users/qwwqwwq/events{/privacy}","received_events_url":"https://api.github.com/users/qwwqwwq/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55/commits","review_comments_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55/comments","review_comment_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/55/comments","statuses_url":"https://api.github.com/repos/bayeshack2016/vetafi/statuses/3be6a3eeefaf2dceb1076fc7f3e040917fe9f2e9","head":{"label":"bayeshack2016:feature_idme","ref":"feature_idme","sha":"3be6a3eeefaf2dceb1076fc7f3e040917fe9f2e9","user":{"login":"bayeshack2016","id":17835477,"avatar_url":"https://avatars.githubusercontent.com/u/17835477?v=3","gravatar_id":"","url":"https://api.github.com/users/bayeshack2016","html_url":"https://github.com/bayeshack2016","followers_url":"https://api.github.com/users/bayeshack2016/followers","following_url":"https://api.github.com/users/bayeshack2016/following{/other_user}","gists_url":"https://api.github.com/users/bayeshack2016/gists{/gist_id}","starred_url":"https://api.github.com/users/bayeshack2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bayeshack2016/subscriptions","organizations_url":"https://api.github.com/users/bayeshack2016/orgs","repos_url":"https://api.github.com/users/bayeshack2016/repos","events_url":"https://api.github.com/users/bayeshack2016/events{/privacy}","received_events_url":"https://api.github.com/users/bayeshack2016/received_events","type":"Organization","site_admin":false},"repo":{"id":56980135,"name":"vetafi","full_name":"bayeshack2016/vetafi","owner":{"login":"bayeshack2016","id":17835477,"avatar_url":"https://avatars.githubusercontent.com/u/17835477?v=3","gravatar_id":"","url":"https://api.github.com/users/bayeshack2016","html_url":"https://github.com/bayeshack2016","followers_url":"https://api.github.com/users/bayeshack2016/followers","following_url":"https://api.github.com/users/bayeshack2016/following{/other_user}","gists_url":"https://api.github.com/users/bayeshack2016/gists{/gist_id}","starred_url":"https://api.github.com/users/bayeshack2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bayeshack2016/subscriptions","organizations_url":"https://api.github.com/users/bayeshack2016/orgs","repos_url":"https://api.github.com/users/bayeshack2016/repos","events_url":"https://api.github.com/users/bayeshack2016/events{/privacy}","received_events_url":"https://api.github.com/users/bayeshack2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bayeshack2016/vetafi","description":"#VA","fork":false,"url":"https://api.github.com/repos/bayeshack2016/vetafi","forks_url":"https://api.github.com/repos/bayeshack2016/vetafi/forks","keys_url":"https://api.github.com/repos/bayeshack2016/vetafi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bayeshack2016/vetafi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bayeshack2016/vetafi/teams","hooks_url":"https://api.github.com/repos/bayeshack2016/vetafi/hooks","issue_events_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/events{/number}","events_url":"https://api.github.com/repos/bayeshack2016/vetafi/events","assignees_url":"https://api.github.com/repos/bayeshack2016/vetafi/assignees{/user}","branches_url":"https://api.github.com/repos/bayeshack2016/vetafi/branches{/branch}","tags_url":"https://api.github.com/repos/bayeshack2016/vetafi/tags","blobs_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/refs{/sha}","trees_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bayeshack2016/vetafi/statuses/{sha}","languages_url":"https://api.github.com/repos/bayeshack2016/vetafi/languages","stargazers_url":"https://api.github.com/repos/bayeshack2016/vetafi/stargazers","contributors_url":"https://api.github.com/repos/bayeshack2016/vetafi/contributors","subscribers_url":"https://api.github.com/repos/bayeshack2016/vetafi/subscribers","subscription_url":"https://api.github.com/repos/bayeshack2016/vetafi/subscription","commits_url":"https://api.github.com/repos/bayeshack2016/vetafi/commits{/sha}","git_commits_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/commits{/sha}","comments_url":"https://api.github.com/repos/bayeshack2016/vetafi/comments{/number}","issue_comment_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/comments{/number}","contents_url":"https://api.github.com/repos/bayeshack2016/vetafi/contents/{+path}","compare_url":"https://api.github.com/repos/bayeshack2016/vetafi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bayeshack2016/vetafi/merges","archive_url":"https://api.github.com/repos/bayeshack2016/vetafi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bayeshack2016/vetafi/downloads","issues_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues{/number}","pulls_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls{/number}","milestones_url":"https://api.github.com/repos/bayeshack2016/vetafi/milestones{/number}","notifications_url":"https://api.github.com/repos/bayeshack2016/vetafi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bayeshack2016/vetafi/labels{/name}","releases_url":"https://api.github.com/repos/bayeshack2016/vetafi/releases{/id}","deployments_url":"https://api.github.com/repos/bayeshack2016/vetafi/deployments","created_at":"2016-04-24T15:50:04Z","updated_at":"2016-09-03T21:12:02Z","pushed_at":"2016-09-08T07:42:49Z","git_url":"git://github.com/bayeshack2016/vetafi.git","ssh_url":"git@github.com:bayeshack2016/vetafi.git","clone_url":"https://github.com/bayeshack2016/vetafi.git","svn_url":"https://github.com/bayeshack2016/vetafi","homepage":null,"size":31095,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"bayeshack2016:master","ref":"master","sha":"3138af3e85c1facb8d3d2adf5831510bf7288eeb","user":{"login":"bayeshack2016","id":17835477,"avatar_url":"https://avatars.githubusercontent.com/u/17835477?v=3","gravatar_id":"","url":"https://api.github.com/users/bayeshack2016","html_url":"https://github.com/bayeshack2016","followers_url":"https://api.github.com/users/bayeshack2016/followers","following_url":"https://api.github.com/users/bayeshack2016/following{/other_user}","gists_url":"https://api.github.com/users/bayeshack2016/gists{/gist_id}","starred_url":"https://api.github.com/users/bayeshack2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bayeshack2016/subscriptions","organizations_url":"https://api.github.com/users/bayeshack2016/orgs","repos_url":"https://api.github.com/users/bayeshack2016/repos","events_url":"https://api.github.com/users/bayeshack2016/events{/privacy}","received_events_url":"https://api.github.com/users/bayeshack2016/received_events","type":"Organization","site_admin":false},"repo":{"id":56980135,"name":"vetafi","full_name":"bayeshack2016/vetafi","owner":{"login":"bayeshack2016","id":17835477,"avatar_url":"https://avatars.githubusercontent.com/u/17835477?v=3","gravatar_id":"","url":"https://api.github.com/users/bayeshack2016","html_url":"https://github.com/bayeshack2016","followers_url":"https://api.github.com/users/bayeshack2016/followers","following_url":"https://api.github.com/users/bayeshack2016/following{/other_user}","gists_url":"https://api.github.com/users/bayeshack2016/gists{/gist_id}","starred_url":"https://api.github.com/users/bayeshack2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bayeshack2016/subscriptions","organizations_url":"https://api.github.com/users/bayeshack2016/orgs","repos_url":"https://api.github.com/users/bayeshack2016/repos","events_url":"https://api.github.com/users/bayeshack2016/events{/privacy}","received_events_url":"https://api.github.com/users/bayeshack2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bayeshack2016/vetafi","description":"#VA","fork":false,"url":"https://api.github.com/repos/bayeshack2016/vetafi","forks_url":"https://api.github.com/repos/bayeshack2016/vetafi/forks","keys_url":"https://api.github.com/repos/bayeshack2016/vetafi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bayeshack2016/vetafi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bayeshack2016/vetafi/teams","hooks_url":"https://api.github.com/repos/bayeshack2016/vetafi/hooks","issue_events_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/events{/number}","events_url":"https://api.github.com/repos/bayeshack2016/vetafi/events","assignees_url":"https://api.github.com/repos/bayeshack2016/vetafi/assignees{/user}","branches_url":"https://api.github.com/repos/bayeshack2016/vetafi/branches{/branch}","tags_url":"https://api.github.com/repos/bayeshack2016/vetafi/tags","blobs_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/refs{/sha}","trees_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bayeshack2016/vetafi/statuses/{sha}","languages_url":"https://api.github.com/repos/bayeshack2016/vetafi/languages","stargazers_url":"https://api.github.com/repos/bayeshack2016/vetafi/stargazers","contributors_url":"https://api.github.com/repos/bayeshack2016/vetafi/contributors","subscribers_url":"https://api.github.com/repos/bayeshack2016/vetafi/subscribers","subscription_url":"https://api.github.com/repos/bayeshack2016/vetafi/subscription","commits_url":"https://api.github.com/repos/bayeshack2016/vetafi/commits{/sha}","git_commits_url":"https://api.github.com/repos/bayeshack2016/vetafi/git/commits{/sha}","comments_url":"https://api.github.com/repos/bayeshack2016/vetafi/comments{/number}","issue_comment_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues/comments{/number}","contents_url":"https://api.github.com/repos/bayeshack2016/vetafi/contents/{+path}","compare_url":"https://api.github.com/repos/bayeshack2016/vetafi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bayeshack2016/vetafi/merges","archive_url":"https://api.github.com/repos/bayeshack2016/vetafi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bayeshack2016/vetafi/downloads","issues_url":"https://api.github.com/repos/bayeshack2016/vetafi/issues{/number}","pulls_url":"https://api.github.com/repos/bayeshack2016/vetafi/pulls{/number}","milestones_url":"https://api.github.com/repos/bayeshack2016/vetafi/milestones{/number}","notifications_url":"https://api.github.com/repos/bayeshack2016/vetafi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bayeshack2016/vetafi/labels{/name}","releases_url":"https://api.github.com/repos/bayeshack2016/vetafi/releases{/id}","deployments_url":"https://api.github.com/repos/bayeshack2016/vetafi/deployments","created_at":"2016-04-24T15:50:04Z","updated_at":"2016-09-03T21:12:02Z","pushed_at":"2016-09-08T07:42:49Z","git_url":"git://github.com/bayeshack2016/vetafi.git","ssh_url":"git@github.com:bayeshack2016/vetafi.git","clone_url":"https://github.com/bayeshack2016/vetafi.git","svn_url":"https://github.com/bayeshack2016/vetafi","homepage":null,"size":31095,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55"},"html":{"href":"https://github.com/bayeshack2016/vetafi/pull/55"},"issue":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/issues/55"},"comments":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/bayeshack2016/vetafi/statuses/3be6a3eeefaf2dceb1076fc7f3e040917fe9f2e9"}}}}
{"actor":{"display_login":"ahsu1230"}}