{"action":"created","issue":{"url":"https://api.github.com/repos/meanjs/mean/issues/1250","repository_url":"https://api.github.com/repos/meanjs/mean","labels_url":"https://api.github.com/repos/meanjs/mean/issues/1250/labels{/name}","comments_url":"https://api.github.com/repos/meanjs/mean/issues/1250/comments","events_url":"https://api.github.com/repos/meanjs/mean/issues/1250/events","html_url":"https://github.com/meanjs/mean/pull/1250","id":138788530,"number":1250,"title":"fix(users): GitHub strategy missing email","user":{"login":"mleanos","id":5613734,"avatar_url":"https://avatars.githubusercontent.com/u/5613734?v=3","gravatar_id":"","url":"https://api.github.com/users/mleanos","html_url":"https://github.com/mleanos","followers_url":"https://api.github.com/users/mleanos/followers","following_url":"https://api.github.com/users/mleanos/following{/other_user}","gists_url":"https://api.github.com/users/mleanos/gists{/gist_id}","starred_url":"https://api.github.com/users/mleanos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mleanos/subscriptions","organizations_url":"https://api.github.com/users/mleanos/orgs","repos_url":"https://api.github.com/users/mleanos/repos","events_url":"https://api.github.com/users/mleanos/events{/privacy}","received_events_url":"https://api.github.com/users/mleanos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/meanjs/mean/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"mleanos","id":5613734,"avatar_url":"https://avatars.githubusercontent.com/u/5613734?v=3","gravatar_id":"","url":"https://api.github.com/users/mleanos","html_url":"https://github.com/mleanos","followers_url":"https://api.github.com/users/mleanos/followers","following_url":"https://api.github.com/users/mleanos/following{/other_user}","gists_url":"https://api.github.com/users/mleanos/gists{/gist_id}","starred_url":"https://api.github.com/users/mleanos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mleanos/subscriptions","organizations_url":"https://api.github.com/users/mleanos/orgs","repos_url":"https://api.github.com/users/mleanos/repos","events_url":"https://api.github.com/users/mleanos/events{/privacy}","received_events_url":"https://api.github.com/users/mleanos/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/meanjs/mean/milestones/6","html_url":"https://github.com/meanjs/mean/milestones/0.5.0","labels_url":"https://api.github.com/repos/meanjs/mean/milestones/6/labels","id":1213421,"number":6,"title":"0.5.0","description":"","creator":{"login":"ilanbiala","id":3695164,"avatar_url":"https://avatars.githubusercontent.com/u/3695164?v=3","gravatar_id":"","url":"https://api.github.com/users/ilanbiala","html_url":"https://github.com/ilanbiala","followers_url":"https://api.github.com/users/ilanbiala/followers","following_url":"https://api.github.com/users/ilanbiala/following{/other_user}","gists_url":"https://api.github.com/users/ilanbiala/gists{/gist_id}","starred_url":"https://api.github.com/users/ilanbiala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilanbiala/subscriptions","organizations_url":"https://api.github.com/users/ilanbiala/orgs","repos_url":"https://api.github.com/users/ilanbiala/repos","events_url":"https://api.github.com/users/ilanbiala/events{/privacy}","received_events_url":"https://api.github.com/users/ilanbiala/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":113,"state":"open","created_at":"2015-07-17T18:54:42Z","updated_at":"2016-03-08T22:02:46Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-03-06T12:47:46Z","updated_at":"2016-03-09T00:18:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/meanjs/mean/pulls/1250","html_url":"https://github.com/meanjs/mean/pull/1250","diff_url":"https://github.com/meanjs/mean/pull/1250.diff","patch_url":"https://github.com/meanjs/mean/pull/1250.patch"},"body":"Fixes an issue with an empty/missing/null Email coming from GitHub's\r\nOAuth call response.\r\n\r\nAlso, introduces the `sparse` index option on the User model's Email\r\nfield. This will ensure that we can have multiple User documents without\r\nthe Email field.\r\n\r\nRelated #1145"},"comment":{"url":"https://api.github.com/repos/meanjs/mean/issues/comments/194033707","html_url":"https://github.com/meanjs/mean/pull/1250#issuecomment-194033707","issue_url":"https://api.github.com/repos/meanjs/mean/issues/1250","id":194033707,"user":{"login":"mleanos","id":5613734,"avatar_url":"https://avatars.githubusercontent.com/u/5613734?v=3","gravatar_id":"","url":"https://api.github.com/users/mleanos","html_url":"https://github.com/mleanos","followers_url":"https://api.github.com/users/mleanos/followers","following_url":"https://api.github.com/users/mleanos/following{/other_user}","gists_url":"https://api.github.com/users/mleanos/gists{/gist_id}","starred_url":"https://api.github.com/users/mleanos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mleanos/subscriptions","organizations_url":"https://api.github.com/users/mleanos/orgs","repos_url":"https://api.github.com/users/mleanos/repos","events_url":"https://api.github.com/users/mleanos/events{/privacy}","received_events_url":"https://api.github.com/users/mleanos/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T00:18:13Z","updated_at":"2016-03-09T00:18:13Z","body":"@lirantal I've been going through the Social Accounts implementation & testing. I've noticed some issues with the other providers as well. This fix is part of a bigger initiative to get the Social Providers working 100%. I have a list of issues I've come across, but haven't organized it yet.\r\n\r\nI have tested this with the other provider's and there aren't any issues, other than the other aspects of the Social Provider's implementation that are broken. However, this does also take care of the issue raised in #1145. \r\n\r\nI did extensive testing with the `sparse` option, and it won't have any adverse effects. The only nuance is that when this is integrated into an existing application, the index on the `email` field in the MongoDB instance would need to be drooped. The next time the application is run, Mongoose will rebuild the index using the `sparse` option. I added a comment in the Schema for that.\r\n\r\nAlso, the test I added will ensure that the `sparse` index works; regardless of which Provider is being used.\r\n"}}