{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/101037263","pull_request_review_id":21754959,"id":101037263,"diff_hunk":"@@ -167,13 +167,61 @@ func LoginByOAuth(c *Context, w http.ResponseWriter, r *http.Request, service st\n \t\treturn nil\n \t}\n \n+\tif err = updateUserAttrs(bytes.NewReader(buf.Bytes()), user, provider, service, c.siteURL); err != nil {\n+\t\tc.Err = err\n+\t\treturn nil\n+\t}\n+\n \tdoLogin(c, w, r, user, \"\")\n \tif c.Err != nil {\n \t\treturn nil\n \t}\n+\n \treturn user\n }\n \n+func updateUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, siteURL string) *model.AppError {","path":"api/user.go","position":17,"original_position":17,"commit_id":"da10db8a1fd7998e1933504b1c5f0a1e08e2220f","original_commit_id":"da10db8a1fd7998e1933504b1c5f0a1e08e2220f","user":{"login":"jwilander","id":2672098,"avatar_url":"https://avatars.githubusercontent.com/u/2672098?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilander","html_url":"https://github.com/jwilander","followers_url":"https://api.github.com/users/jwilander/followers","following_url":"https://api.github.com/users/jwilander/following{/other_user}","gists_url":"https://api.github.com/users/jwilander/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilander/subscriptions","organizations_url":"https://api.github.com/users/jwilander/orgs","repos_url":"https://api.github.com/users/jwilander/repos","events_url":"https://api.github.com/users/jwilander/events{/privacy}","received_events_url":"https://api.github.com/users/jwilander/received_events","type":"User","site_admin":false},"body":"Would you be able to move this function into the `app` package in `app/user.go`?\r\n\r\nCould you also update the function name to be `UpdateOAuthUserAttrs` so we know it's meant for OAuth?","created_at":"2017-02-14T13:48:00Z","updated_at":"2017-02-14T13:49:54Z","html_url":"https://github.com/mattermost/platform/pull/5324#discussion_r101037263","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/5324","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/101037263"},"html":{"href":"https://github.com/mattermost/platform/pull/5324#discussion_r101037263"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/5324"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/5324","id":105017228,"html_url":"https://github.com/mattermost/platform/pull/5324","diff_url":"https://github.com/mattermost/platform/pull/5324.diff","patch_url":"https://github.com/mattermost/platform/pull/5324.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/5324","number":5324,"state":"open","locked":false,"title":"Updating user attributes on changes in OAuth Provider","user":{"login":"mpoornima","id":1185549,"avatar_url":"https://avatars.githubusercontent.com/u/1185549?v=3","gravatar_id":"","url":"https://api.github.com/users/mpoornima","html_url":"https://github.com/mpoornima","followers_url":"https://api.github.com/users/mpoornima/followers","following_url":"https://api.github.com/users/mpoornima/following{/other_user}","gists_url":"https://api.github.com/users/mpoornima/gists{/gist_id}","starred_url":"https://api.github.com/users/mpoornima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpoornima/subscriptions","organizations_url":"https://api.github.com/users/mpoornima/orgs","repos_url":"https://api.github.com/users/mpoornima/repos","events_url":"https://api.github.com/users/mpoornima/events{/privacy}","received_events_url":"https://api.github.com/users/mpoornima/received_events","type":"User","site_admin":false},"body":"#### Summary\r\nUpdates user's Username, Email, FirstName & LastName on login if the corresponding attributes have changed in the Auth Provider\r\n\r\n#### Ticket Link\r\nJira: [PLT-3751](https://mattermost.atlassian.net/browse/PLT-3751)\r\nGitHub: #5288   \r\n\r\n#### Checklist\r\n- [x] Added or updated unit tests\r\n- [ ] Added API documentation\r\n- [ ] Has UI changes\r\n- [x] Includes text changes and localization file ([.../i18n/en.json](https://github.com/mattermost/platform/blob/master/i18n/en.json) and [.../webapp/i18n/en.json](https://github.com/mattermost/platform/tree/master/webapp/i18n/en.json)) updates\r\n- [ ] Touches critical sections of the codebase (auth, upgrade, etc.)\r\n\r\nThanks  ","created_at":"2017-02-07T14:34:47Z","updated_at":"2017-02-14T13:49:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"112cf6deb34d76743c059fd773ac46e8e70f67fc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/5324/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/5324/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/5324/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/da10db8a1fd7998e1933504b1c5f0a1e08e2220f","head":{"label":"mpoornima:PLT-3751","ref":"PLT-3751","sha":"da10db8a1fd7998e1933504b1c5f0a1e08e2220f","user":{"login":"mpoornima","id":1185549,"avatar_url":"https://avatars.githubusercontent.com/u/1185549?v=3","gravatar_id":"","url":"https://api.github.com/users/mpoornima","html_url":"https://github.com/mpoornima","followers_url":"https://api.github.com/users/mpoornima/followers","following_url":"https://api.github.com/users/mpoornima/following{/other_user}","gists_url":"https://api.github.com/users/mpoornima/gists{/gist_id}","starred_url":"https://api.github.com/users/mpoornima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpoornima/subscriptions","organizations_url":"https://api.github.com/users/mpoornima/orgs","repos_url":"https://api.github.com/users/mpoornima/repos","events_url":"https://api.github.com/users/mpoornima/events{/privacy}","received_events_url":"https://api.github.com/users/mpoornima/received_events","type":"User","site_admin":false},"repo":{"id":79653684,"name":"platform","full_name":"mpoornima/platform","owner":{"login":"mpoornima","id":1185549,"avatar_url":"https://avatars.githubusercontent.com/u/1185549?v=3","gravatar_id":"","url":"https://api.github.com/users/mpoornima","html_url":"https://github.com/mpoornima","followers_url":"https://api.github.com/users/mpoornima/followers","following_url":"https://api.github.com/users/mpoornima/following{/other_user}","gists_url":"https://api.github.com/users/mpoornima/gists{/gist_id}","starred_url":"https://api.github.com/users/mpoornima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpoornima/subscriptions","organizations_url":"https://api.github.com/users/mpoornima/orgs","repos_url":"https://api.github.com/users/mpoornima/repos","events_url":"https://api.github.com/users/mpoornima/events{/privacy}","received_events_url":"https://api.github.com/users/mpoornima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mpoornima/platform","description":"Open source Slack-alternative in Golang and React - Mattermost","fork":true,"url":"https://api.github.com/repos/mpoornima/platform","forks_url":"https://api.github.com/repos/mpoornima/platform/forks","keys_url":"https://api.github.com/repos/mpoornima/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mpoornima/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mpoornima/platform/teams","hooks_url":"https://api.github.com/repos/mpoornima/platform/hooks","issue_events_url":"https://api.github.com/repos/mpoornima/platform/issues/events{/number}","events_url":"https://api.github.com/repos/mpoornima/platform/events","assignees_url":"https://api.github.com/repos/mpoornima/platform/assignees{/user}","branches_url":"https://api.github.com/repos/mpoornima/platform/branches{/branch}","tags_url":"https://api.github.com/repos/mpoornima/platform/tags","blobs_url":"https://api.github.com/repos/mpoornima/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mpoornima/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mpoornima/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/mpoornima/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mpoornima/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/mpoornima/platform/languages","stargazers_url":"https://api.github.com/repos/mpoornima/platform/stargazers","contributors_url":"https://api.github.com/repos/mpoornima/platform/contributors","subscribers_url":"https://api.github.com/repos/mpoornima/platform/subscribers","subscription_url":"https://api.github.com/repos/mpoornima/platform/subscription","commits_url":"https://api.github.com/repos/mpoornima/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/mpoornima/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/mpoornima/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/mpoornima/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/mpoornima/platform/contents/{+path}","compare_url":"https://api.github.com/repos/mpoornima/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mpoornima/platform/merges","archive_url":"https://api.github.com/repos/mpoornima/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mpoornima/platform/downloads","issues_url":"https://api.github.com/repos/mpoornima/platform/issues{/number}","pulls_url":"https://api.github.com/repos/mpoornima/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/mpoornima/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/mpoornima/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mpoornima/platform/labels{/name}","releases_url":"https://api.github.com/repos/mpoornima/platform/releases{/id}","deployments_url":"https://api.github.com/repos/mpoornima/platform/deployments","created_at":"2017-01-21T15:23:51Z","updated_at":"2017-01-21T15:23:57Z","pushed_at":"2017-02-07T14:06:21Z","git_url":"git://github.com/mpoornima/platform.git","ssh_url":"git@github.com:mpoornima/platform.git","clone_url":"https://github.com/mpoornima/platform.git","svn_url":"https://github.com/mpoornima/platform","homepage":"https://mattermost.com","size":71342,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"17d1ed114c78e77d3608929873d49e95f03368a7","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":37448451,"name":"platform","full_name":"mattermost/platform","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/platform","description":"Open source Slack-alternative in Golang and React - Mattermost","fork":false,"url":"https://api.github.com/repos/mattermost/platform","forks_url":"https://api.github.com/repos/mattermost/platform/forks","keys_url":"https://api.github.com/repos/mattermost/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/platform/teams","hooks_url":"https://api.github.com/repos/mattermost/platform/hooks","issue_events_url":"https://api.github.com/repos/mattermost/platform/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/platform/events","assignees_url":"https://api.github.com/repos/mattermost/platform/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/platform/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/platform/tags","blobs_url":"https://api.github.com/repos/mattermost/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/platform/languages","stargazers_url":"https://api.github.com/repos/mattermost/platform/stargazers","contributors_url":"https://api.github.com/repos/mattermost/platform/contributors","subscribers_url":"https://api.github.com/repos/mattermost/platform/subscribers","subscription_url":"https://api.github.com/repos/mattermost/platform/subscription","commits_url":"https://api.github.com/repos/mattermost/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/platform/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/platform/merges","archive_url":"https://api.github.com/repos/mattermost/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/platform/downloads","issues_url":"https://api.github.com/repos/mattermost/platform/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/platform/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/platform/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/platform/deployments","created_at":"2015-06-15T06:50:02Z","updated_at":"2017-02-14T12:55:56Z","pushed_at":"2017-02-14T13:42:34Z","git_url":"git://github.com/mattermost/platform.git","ssh_url":"git@github.com:mattermost/platform.git","clone_url":"https://github.com/mattermost/platform.git","svn_url":"https://github.com/mattermost/platform","homepage":"https://mattermost.com","size":71652,"stargazers_count":9968,"watchers_count":9968,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1429,"mirror_url":null,"open_issues_count":130,"forks":1429,"open_issues":130,"watchers":9968,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/5324"},"html":{"href":"https://github.com/mattermost/platform/pull/5324"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/5324"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/5324/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/5324/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/5324/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/da10db8a1fd7998e1933504b1c5f0a1e08e2220f"}}}}
{"actor":{"display_login":"jwilander"}}