{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments/61776340","id":61776340,"diff_hunk":"@@ -72,44 +72,50 @@ function dosomething_northstar_verify_user($credentials) {\n }\n \n /**\n+ * Save the user's Northstar ID to their local profile.\n+ *\n+ * @param $user - Drupal user\n+ * @param $northstar_response - Northstar user JSON response\n+ */\n+function dosomething_northstar_save_id_field($user, $northstar_response) {","path":"lib/modules/dosomething/dosomething_northstar/dosomething_northstar.module","position":9,"original_position":9,"commit_id":"4a655c7929f35f785bc0b01f83358171c1d42f07","original_commit_id":"4a655c7929f35f785bc0b01f83358171c1d42f07","user":{"login":"angaither","id":645205,"avatar_url":"https://avatars.githubusercontent.com/u/645205?v=3","gravatar_id":"","url":"https://api.github.com/users/angaither","html_url":"https://github.com/angaither","followers_url":"https://api.github.com/users/angaither/followers","following_url":"https://api.github.com/users/angaither/following{/other_user}","gists_url":"https://api.github.com/users/angaither/gists{/gist_id}","starred_url":"https://api.github.com/users/angaither/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angaither/subscriptions","organizations_url":"https://api.github.com/users/angaither/orgs","repos_url":"https://api.github.com/users/angaither/repos","events_url":"https://api.github.com/users/angaither/events{/privacy}","received_events_url":"https://api.github.com/users/angaither/received_events","type":"User","site_admin":false},"body":"we have some [getters](https://github.com/DoSomething/phoenix/blob/dev/lib/modules/dosomething/dosomething_user/dosomething_user.module#L1171) and [setters](https://github.com/DoSomething/phoenix/blob/dev/lib/modules/dosomething/dosomething_user/dosomething_user.module#L1235) in the user module, maybe this should live there? ","created_at":"2016-05-02T18:01:41Z","updated_at":"2016-05-02T18:01:41Z","html_url":"https://github.com/DoSomething/phoenix/pull/6401#discussion_r61776340","pull_request_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments/61776340"},"html":{"href":"https://github.com/DoSomething/phoenix/pull/6401#discussion_r61776340"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401","id":68594122,"html_url":"https://github.com/DoSomething/phoenix/pull/6401","diff_url":"https://github.com/DoSomething/phoenix/pull/6401.diff","patch_url":"https://github.com/DoSomething/phoenix/pull/6401.patch","issue_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6401","number":6401,"state":"open","locked":false,"title":"Fix bugs with Northstar auth verification.","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nThis pull request includes cleanup and fixes to the Northstar auth verification & sync code:\r\n\r\n🐛 The \"verify\" check was previously being run on newly registered users (_before_ their profiles were synced to Northstar), resulting in \"failed\" validation and a bunch of users with `NONE` saved to their Northstar ID field. This PR moves this call to occur in a submit handler on the login form, rather than a Drupal hook. Also now just sends \"username\" and lets Northstar infer which type. (4a655c7)\r\n\r\n📄 Updates docblocks to try to make it clearer when different hooks and submit handlers are run, since it was ambiguous from looking at the method names without plopping `dpm` hooks everywhere. (ab3ec96)\r\n\r\n👉 Adds a helper method to save the \"Northstar ID\" profile field, since the syntax is kinda wonky and it's nice to not have the same code duplicated all over. (71c70e8)\r\n\r\n🍃 Removes some commented out code from the Northstar Guzzle implementation, since it was making that file harder to skim. Once we revisit #5932, hopefully we can start using the Northstar PHP library here instead! (3f86eb6)\r\n\r\n🍂 General tidying up. (c502379, a7df8ff, 939b0bb)\r\n\r\n#### How should this be manually tested?\r\nIt's probably easiest to just test this on staging TBH. But there should be significantly fewer cases where users have `NONE` for their Northstar ID field, since it's now properly set on registration.\r\n\r\n#### Any background context you want to provide?\r\n👻 \r\n\r\n#### What are the relevant tickets?\r\nReferences #6260.\r\n\r\n---\r\nFor review: @angaither @weerd ","created_at":"2016-05-02T17:51:13Z","updated_at":"2016-05-02T18:01:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be310e23ab36a8e15b42149708beef13814da26f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401/commits","review_comments_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401/comments","review_comment_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6401/comments","statuses_url":"https://api.github.com/repos/DoSomething/phoenix/statuses/4a655c7929f35f785bc0b01f83358171c1d42f07","head":{"label":"DFurnes:northstar-verify-touchups","ref":"northstar-verify-touchups","sha":"4a655c7929f35f785bc0b01f83358171c1d42f07","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"repo":{"id":23975099,"name":"phoenix","full_name":"DFurnes/phoenix","owner":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DFurnes/phoenix","description":"A Drupal 7 distribution that powers the DoSomething.org web platform.","fork":true,"url":"https://api.github.com/repos/DFurnes/phoenix","forks_url":"https://api.github.com/repos/DFurnes/phoenix/forks","keys_url":"https://api.github.com/repos/DFurnes/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DFurnes/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DFurnes/phoenix/teams","hooks_url":"https://api.github.com/repos/DFurnes/phoenix/hooks","issue_events_url":"https://api.github.com/repos/DFurnes/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/DFurnes/phoenix/events","assignees_url":"https://api.github.com/repos/DFurnes/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/DFurnes/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/DFurnes/phoenix/tags","blobs_url":"https://api.github.com/repos/DFurnes/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DFurnes/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DFurnes/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/DFurnes/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DFurnes/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/DFurnes/phoenix/languages","stargazers_url":"https://api.github.com/repos/DFurnes/phoenix/stargazers","contributors_url":"https://api.github.com/repos/DFurnes/phoenix/contributors","subscribers_url":"https://api.github.com/repos/DFurnes/phoenix/subscribers","subscription_url":"https://api.github.com/repos/DFurnes/phoenix/subscription","commits_url":"https://api.github.com/repos/DFurnes/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/DFurnes/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/DFurnes/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/DFurnes/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/DFurnes/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/DFurnes/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DFurnes/phoenix/merges","archive_url":"https://api.github.com/repos/DFurnes/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DFurnes/phoenix/downloads","issues_url":"https://api.github.com/repos/DFurnes/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/DFurnes/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/DFurnes/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/DFurnes/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DFurnes/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/DFurnes/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/DFurnes/phoenix/deployments","created_at":"2014-09-12T20:07:06Z","updated_at":"2016-01-29T19:33:17Z","pushed_at":"2016-05-02T17:41:46Z","git_url":"git://github.com/DFurnes/phoenix.git","ssh_url":"git@github.com:DFurnes/phoenix.git","clone_url":"https://github.com/DFurnes/phoenix.git","svn_url":"https://github.com/DFurnes/phoenix","homepage":"http://www.dosomething.org/","size":16778,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"dev"}},"base":{"label":"DoSomething:dev","ref":"dev","sha":"696a915ade1e7a25f4dcb216cad3b609ef6a7e4b","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":13592927,"name":"phoenix","full_name":"DoSomething/phoenix","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/phoenix","description":"A Drupal 7 distribution that powers the DoSomething.org web platform.","fork":false,"url":"https://api.github.com/repos/DoSomething/phoenix","forks_url":"https://api.github.com/repos/DoSomething/phoenix/forks","keys_url":"https://api.github.com/repos/DoSomething/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/phoenix/teams","hooks_url":"https://api.github.com/repos/DoSomething/phoenix/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/phoenix/events","assignees_url":"https://api.github.com/repos/DoSomething/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/phoenix/tags","blobs_url":"https://api.github.com/repos/DoSomething/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/phoenix/languages","stargazers_url":"https://api.github.com/repos/DoSomething/phoenix/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/phoenix/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/phoenix/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/phoenix/subscription","commits_url":"https://api.github.com/repos/DoSomething/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/phoenix/merges","archive_url":"https://api.github.com/repos/DoSomething/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/phoenix/downloads","issues_url":"https://api.github.com/repos/DoSomething/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/phoenix/deployments","created_at":"2013-10-15T14:50:48Z","updated_at":"2016-01-11T18:53:47Z","pushed_at":"2016-05-02T17:51:13Z","git_url":"git://github.com/DoSomething/phoenix.git","ssh_url":"git@github.com:DoSomething/phoenix.git","clone_url":"https://github.com/DoSomething/phoenix.git","svn_url":"https://github.com/DoSomething/phoenix","homepage":"http://www.dosomething.org/","size":17560,"stargazers_count":28,"watchers_count":28,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":198,"forks":19,"open_issues":198,"watchers":28,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401"},"html":{"href":"https://github.com/DoSomething/phoenix/pull/6401"},"issue":{"href":"https://api.github.com/repos/DoSomething/phoenix/issues/6401"},"comments":{"href":"https://api.github.com/repos/DoSomething/phoenix/issues/6401/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6401/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/phoenix/statuses/4a655c7929f35f785bc0b01f83358171c1d42f07"}}}}