{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/61868378","id":61868378,"diff_hunk":"@@ -431,114 +430,121 @@ func SendVerifyEmailAndForget(c *Context, userId, userEmail, siteURL string) {\n func login(c *Context, w http.ResponseWriter, r *http.Request) {\n \tprops := model.MapFromJson(r.Body)\n \n-\tif len(props[\"password\"]) == 0 {\n+\tid := props[\"id\"]\n+\tloginId := props[\"login_id\"]\n+\tpassword := props[\"password\"]\n+\tmfaToken := props[\"token\"]\n+\tdeviceId := props[\"device_id\"]\n+\n+\tif len(password) == 0 {\n \t\tc.Err = model.NewLocAppError(\"login\", \"api.user.login.blank_pwd.app_error\", nil, \"\")\n \t\tc.Err.StatusCode = http.StatusBadRequest\n \t\treturn\n \t}\n \n+\tc.LogAudit(\"attempt\")\n+\n \tvar user *model.User\n-\tif len(props[\"id\"]) != 0 {\n-\t\tuser = LoginById(c, w, r, props[\"id\"], props[\"password\"], props[\"token\"], props[\"device_id\"])\n-\t} else if len(props[\"email\"]) != 0 {\n-\t\tuser = LoginByEmail(c, w, r, props[\"email\"], props[\"name\"], props[\"password\"], props[\"token\"], props[\"device_id\"])\n-\t} else if len(props[\"username\"]) != 0 {\n-\t\tuser = LoginByUsername(c, w, r, props[\"username\"], props[\"name\"], props[\"password\"], props[\"token\"], props[\"device_id\"])\n+\tvar err *model.AppError\n+","path":"api/user.go","position":44,"original_position":44,"commit_id":"e0ff9e3b959091209d8c6e551b1b5588ac2ca396","original_commit_id":"e0ff9e3b959091209d8c6e551b1b5588ac2ca396","user":{"login":"crspeller","id":3191642,"avatar_url":"https://avatars.githubusercontent.com/u/3191642?v=3","gravatar_id":"","url":"https://api.github.com/users/crspeller","html_url":"https://github.com/crspeller","followers_url":"https://api.github.com/users/crspeller/followers","following_url":"https://api.github.com/users/crspeller/following{/other_user}","gists_url":"https://api.github.com/users/crspeller/gists{/gist_id}","starred_url":"https://api.github.com/users/crspeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crspeller/subscriptions","organizations_url":"https://api.github.com/users/crspeller/orgs","repos_url":"https://api.github.com/users/crspeller/repos","events_url":"https://api.github.com/users/crspeller/events{/privacy}","received_events_url":"https://api.github.com/users/crspeller/received_events","type":"User","site_admin":false},"body":"We should audit lookup failures. Otherwise we have attempts without success or failure. ","created_at":"2016-05-03T11:41:49Z","updated_at":"2016-05-03T11:41:49Z","html_url":"https://github.com/mattermost/platform/pull/2820#discussion_r61868378","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/2820","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/61868378"},"html":{"href":"https://github.com/mattermost/platform/pull/2820#discussion_r61868378"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/2820"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/2820","id":68252151,"html_url":"https://github.com/mattermost/platform/pull/2820","diff_url":"https://github.com/mattermost/platform/pull/2820.diff","patch_url":"https://github.com/mattermost/platform/pull/2820.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/2820","number":2820,"state":"open","locked":false,"title":"PLT-2258 Unified login screen and related APIs","user":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"body":"Enterprise PR to update unit tests: https://github.com/mattermost/enterprise/pull/21","created_at":"2016-04-28T16:38:20Z","updated_at":"2016-05-03T11:41:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"166470e620b4f126d46005eeff6a76c64e13c252","assignee":null,"milestone":{"url":"https://api.github.com/repos/mattermost/platform/milestones/12","html_url":"https://github.com/mattermost/platform/milestones/v3.0.0","labels_url":"https://api.github.com/repos/mattermost/platform/milestones/12/labels","id":1722953,"number":12,"title":"v3.0.0","description":"","creator":{"login":"crspeller","id":3191642,"avatar_url":"https://avatars.githubusercontent.com/u/3191642?v=3","gravatar_id":"","url":"https://api.github.com/users/crspeller","html_url":"https://github.com/crspeller","followers_url":"https://api.github.com/users/crspeller/followers","following_url":"https://api.github.com/users/crspeller/following{/other_user}","gists_url":"https://api.github.com/users/crspeller/gists{/gist_id}","starred_url":"https://api.github.com/users/crspeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crspeller/subscriptions","organizations_url":"https://api.github.com/users/crspeller/orgs","repos_url":"https://api.github.com/users/crspeller/repos","events_url":"https://api.github.com/users/crspeller/events{/privacy}","received_events_url":"https://api.github.com/users/crspeller/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":10,"state":"open","created_at":"2016-04-21T14:50:35Z","updated_at":"2016-05-02T21:16:22Z","due_on":"2016-05-16T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/2820/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/2820/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/2820/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/e0ff9e3b959091209d8c6e551b1b5588ac2ca396","head":{"label":"hmhealey:plt2258","ref":"plt2258","sha":"e0ff9e3b959091209d8c6e551b1b5588ac2ca396","user":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"repo":{"id":38433989,"name":"mattermost-platform","full_name":"hmhealey/mattermost-platform","owner":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hmhealey/mattermost-platform","description":"Open source team communication across PC & phones, with archiving & search, in Golang and React","fork":true,"url":"https://api.github.com/repos/hmhealey/mattermost-platform","forks_url":"https://api.github.com/repos/hmhealey/mattermost-platform/forks","keys_url":"https://api.github.com/repos/hmhealey/mattermost-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmhealey/mattermost-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmhealey/mattermost-platform/teams","hooks_url":"https://api.github.com/repos/hmhealey/mattermost-platform/hooks","issue_events_url":"https://api.github.com/repos/hmhealey/mattermost-platform/issues/events{/number}","events_url":"https://api.github.com/repos/hmhealey/mattermost-platform/events","assignees_url":"https://api.github.com/repos/hmhealey/mattermost-platform/assignees{/user}","branches_url":"https://api.github.com/repos/hmhealey/mattermost-platform/branches{/branch}","tags_url":"https://api.github.com/repos/hmhealey/mattermost-platform/tags","blobs_url":"https://api.github.com/repos/hmhealey/mattermost-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmhealey/mattermost-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmhealey/mattermost-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmhealey/mattermost-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmhealey/mattermost-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/hmhealey/mattermost-platform/languages","stargazers_url":"https://api.github.com/repos/hmhealey/mattermost-platform/stargazers","contributors_url":"https://api.github.com/repos/hmhealey/mattermost-platform/contributors","subscribers_url":"https://api.github.com/repos/hmhealey/mattermost-platform/subscribers","subscription_url":"https://api.github.com/repos/hmhealey/mattermost-platform/subscription","commits_url":"https://api.github.com/repos/hmhealey/mattermost-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmhealey/mattermost-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmhealey/mattermost-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmhealey/mattermost-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmhealey/mattermost-platform/contents/{+path}","compare_url":"https://api.github.com/repos/hmhealey/mattermost-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmhealey/mattermost-platform/merges","archive_url":"https://api.github.com/repos/hmhealey/mattermost-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmhealey/mattermost-platform/downloads","issues_url":"https://api.github.com/repos/hmhealey/mattermost-platform/issues{/number}","pulls_url":"https://api.github.com/repos/hmhealey/mattermost-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/hmhealey/mattermost-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/hmhealey/mattermost-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmhealey/mattermost-platform/labels{/name}","releases_url":"https://api.github.com/repos/hmhealey/mattermost-platform/releases{/id}","deployments_url":"https://api.github.com/repos/hmhealey/mattermost-platform/deployments","created_at":"2015-07-02T13:21:29Z","updated_at":"2016-01-11T16:05:20Z","pushed_at":"2016-05-02T20:33:07Z","git_url":"git://github.com/hmhealey/mattermost-platform.git","ssh_url":"git@github.com:hmhealey/mattermost-platform.git","clone_url":"https://github.com/hmhealey/mattermost-platform.git","svn_url":"https://github.com/hmhealey/mattermost-platform","homepage":"http://mattermost.org","size":42216,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"2fb6c689b7291117e691d50f51fdda2451db9da3","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":"2016-05-03T09:34:16Z","pushed_at":"2016-05-03T10:57:09Z","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":48609,"stargazers_count":7798,"watchers_count":7798,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":826,"mirror_url":null,"open_issues_count":28,"forks":826,"open_issues":28,"watchers":7798,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/2820"},"html":{"href":"https://github.com/mattermost/platform/pull/2820"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/2820"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/2820/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/2820/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/2820/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/e0ff9e3b959091209d8c6e551b1b5588ac2ca396"}}}}