{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/38138470","id":38138470,"diff_hunk":"@@ -529,23 +531,52 @@ func signupCompleteOAuth(c *api.Context, w http.ResponseWriter, r *http.Request)\n \t\t\treturn\n \t\t}\n \n-\t\tif result := <-api.Srv.Store.User().GetByAuth(team.Id, user.AuthData, service); result.Err == nil {\n+\t\tsuchan := api.Srv.Store.User().GetByAuth(team.Id, user.AuthData, service)\n+\t\teuchan := api.Srv.Store.User().GetByEmail(team.Id, user.Email)\n+\n+\t\tif team.Email == \"\" {\n+\t\t\tteam.Email = user.Email\n+\t\t\tif result := <-api.Srv.Store.Team().Update(team); result.Err != nil {\n+\t\t\t\tc.Err = result.Err\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t} else {\n+\t\t\tfound := true\n+\t\t\tcount := 0","path":"web/web.go","position":32,"original_position":32,"commit_id":"afa13a3d4fa34026ad5976f89dd7cf4ae02b9c00","original_commit_id":"afa13a3d4fa34026ad5976f89dd7cf4ae02b9c00","user":{"login":"coreyhulen","id":1431746,"avatar_url":"https://avatars.githubusercontent.com/u/1431746?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyhulen","html_url":"https://github.com/coreyhulen","followers_url":"https://api.github.com/users/coreyhulen/followers","following_url":"https://api.github.com/users/coreyhulen/following{/other_user}","gists_url":"https://api.github.com/users/coreyhulen/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyhulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyhulen/subscriptions","organizations_url":"https://api.github.com/users/coreyhulen/orgs","repos_url":"https://api.github.com/users/coreyhulen/repos","events_url":"https://api.github.com/users/coreyhulen/events{/privacy}","received_events_url":"https://api.github.com/users/coreyhulen/received_events","type":"User","site_admin":false},"body":"ah...k.  one is username the other is email.","created_at":"2015-08-27T19:51:42Z","updated_at":"2015-08-27T19:51:42Z","html_url":"https://github.com/mattermost/platform/pull/496#discussion_r38138470","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/496","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/38138470"},"html":{"href":"https://github.com/mattermost/platform/pull/496#discussion_r38138470"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/496"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/496","id":43542389,"html_url":"https://github.com/mattermost/platform/pull/496","diff_url":"https://github.com/mattermost/platform/pull/496.diff","patch_url":"https://github.com/mattermost/platform/pull/496.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/496","number":496,"state":"open","locked":false,"title":"MM-2015 Added the ability to create a team with SSO services and added the ability to turn off email sign up.","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":"","created_at":"2015-08-27T17:11:37Z","updated_at":"2015-08-27T19:51:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e638fe301f4fae26e5d0ded154fec79a503e3e0b","assignee":{"login":"coreyhulen","id":1431746,"avatar_url":"https://avatars.githubusercontent.com/u/1431746?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyhulen","html_url":"https://github.com/coreyhulen","followers_url":"https://api.github.com/users/coreyhulen/followers","following_url":"https://api.github.com/users/coreyhulen/following{/other_user}","gists_url":"https://api.github.com/users/coreyhulen/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyhulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyhulen/subscriptions","organizations_url":"https://api.github.com/users/coreyhulen/orgs","repos_url":"https://api.github.com/users/coreyhulen/repos","events_url":"https://api.github.com/users/coreyhulen/events{/privacy}","received_events_url":"https://api.github.com/users/coreyhulen/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mattermost/platform/milestones/2","html_url":"https://github.com/mattermost/platform/milestones/v0.7.0","labels_url":"https://api.github.com/repos/mattermost/platform/milestones/2/labels","id":1229900,"number":2,"title":"v0.7.0","description":"","creator":{"login":"it33","id":177788,"avatar_url":"https://avatars.githubusercontent.com/u/177788?v=3","gravatar_id":"","url":"https://api.github.com/users/it33","html_url":"https://github.com/it33","followers_url":"https://api.github.com/users/it33/followers","following_url":"https://api.github.com/users/it33/following{/other_user}","gists_url":"https://api.github.com/users/it33/gists{/gist_id}","starred_url":"https://api.github.com/users/it33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it33/subscriptions","organizations_url":"https://api.github.com/users/it33/orgs","repos_url":"https://api.github.com/users/it33/repos","events_url":"https://api.github.com/users/it33/events{/privacy}","received_events_url":"https://api.github.com/users/it33/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":96,"state":"open","created_at":"2015-07-28T17:01:12Z","updated_at":"2015-08-27T19:26:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/496/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/496/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/496/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/afa13a3d4fa34026ad5976f89dd7cf4ae02b9c00","head":{"label":"mattermost:mm-2015","ref":"mm-2015","sha":"afa13a3d4fa34026ad5976f89dd7cf4ae02b9c00","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","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}","created_at":"2015-06-15T06:50:02Z","updated_at":"2015-08-27T19:21:12Z","pushed_at":"2015-08-27T19:26:08Z","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":"http://mattermost.org","size":11290,"stargazers_count":2876,"watchers_count":2876,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":230,"mirror_url":null,"open_issues_count":21,"forks":230,"open_issues":21,"watchers":2876,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"db7e8c12889485234fb2d1ba6556106e5fc7548b","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","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}","created_at":"2015-06-15T06:50:02Z","updated_at":"2015-08-27T19:21:12Z","pushed_at":"2015-08-27T19:26:08Z","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":"http://mattermost.org","size":11290,"stargazers_count":2876,"watchers_count":2876,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":230,"mirror_url":null,"open_issues_count":21,"forks":230,"open_issues":21,"watchers":2876,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/496"},"html":{"href":"https://github.com/mattermost/platform/pull/496"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/496"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/496/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/496/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/496/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/afa13a3d4fa34026ad5976f89dd7cf4ae02b9c00"}}}}