{"action":"opened","issue":{"url":"https://api.github.com/repos/eventedmind/feed-customizing-login/issues/1","repository_url":"https://api.github.com/repos/eventedmind/feed-customizing-login","labels_url":"https://api.github.com/repos/eventedmind/feed-customizing-login/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/eventedmind/feed-customizing-login/issues/1/comments","events_url":"https://api.github.com/repos/eventedmind/feed-customizing-login/issues/1/events","html_url":"https://github.com/eventedmind/feed-customizing-login/issues/1","id":157450345,"number":1,"title":"No email update happens","user":{"login":"openqubit","id":14041281,"avatar_url":"https://avatars.githubusercontent.com/u/14041281?v=3","gravatar_id":"","url":"https://api.github.com/users/openqubit","html_url":"https://github.com/openqubit","followers_url":"https://api.github.com/users/openqubit/followers","following_url":"https://api.github.com/users/openqubit/following{/other_user}","gists_url":"https://api.github.com/users/openqubit/gists{/gist_id}","starred_url":"https://api.github.com/users/openqubit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openqubit/subscriptions","organizations_url":"https://api.github.com/users/openqubit/orgs","repos_url":"https://api.github.com/users/openqubit/repos","events_url":"https://api.github.com/users/openqubit/events{/privacy}","received_events_url":"https://api.github.com/users/openqubit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-30T07:53:58Z","updated_at":"2016-05-30T07:53:58Z","closed_at":null,"body":"I am trying the code as the tutorial says\r\n\r\n```\r\nif(Meteor.isServer) {\r\n  \r\nServiceConfiguration.configurations.upsert({service: 'github'}, {\r\n    $set: {\r\n      clientId: 'hidden',\r\n      secret: 'hidden',\r\n      loginStyle: 'popup'\r\n    }\r\n  });\r\n\r\n  function getUserInfo (accessToken) {\r\n    let result = HTTP.get(\"https://api.github.com/user\", {\r\n      headers: {\r\n        'User-Agent': 'Meteor'\r\n      },\r\n\r\n      params: {\r\n        access_token: accessToken\r\n      }\r\n    });\r\n\r\n    return _.pick(result.data, 'login', 'email');\r\n  }\r\n\r\n  Accounts.onCreateUser((options, user) => {\r\n    user.profile = getUserInfo(user.services.github.accessToken);\r\n    user.login = user.profile.login;\r\n    user.email = user.profile.email;\r\n    return user;\r\n  });\r\n\r\n  Accounts.onLogin((loginInfo) => {\r\n    let user = loginInfo.user;\r\n    let accessToken = user.services.github.accessToken;\r\n    let userInfo = getUserInfo(accessToken);\r\n    Meteor.users.update({_id: user._id}, {\r\n      $set: {\r\n        profile: userInfo,\r\n        login: userInfo.login,\r\n        email: userInfo.email\r\n      }\r\n   });\r\n  });\r\n};\r\n```\r\n\r\nbut email is not updated. \r\n\r\nMongo find()\r\n\r\n```\r\nmeteor:PRIMARY> db.users.find()\r\n{\r\n\t\"_id\" : \"wdczepSSSLtMBbPuz\",\r\n\t\"createdAt\" : ISODate(\"2016-05-30T07:11:04.525Z\"),\r\n\t\"services\" : {\r\n\t\t\"github\" : {\r\n\t\t\t\"id\" : 14041281,\r\n\t\t\t\"accessToken\" : \"4f77ece8f622146fa0737bbf18c55e87ec0da73f\",\r\n\t\t\t\"email\" : \"\",\r\n\t\t\t\"username\" : \"openqubit\",\r\n\t\t\t\"emails\" : [ ]\r\n\t\t},\r\n\t\t\"resume\" : {\r\n\t\t\t\"loginTokens\" : [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"when\" : ISODate(\"2016-05-30T07:44:36.405Z\"),\r\n\t\t\t\t\t\"hashedToken\" : \"OivxihiWriKk/fHRQM4/qAJlvk9eRbeIQGWFt+9DYQ0=\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t},\r\n\t\"profile\" : {\r\n\t\t\"login\" : \"openqubit\",\r\n\t\t\"email\" : null\r\n\t},\r\n\t\"login\" : \"openqubit\",\r\n\t\"email\" : null\r\n}\r\nmeteor:PRIMARY> \r\n```\r\n"}}
{"actor":{"display_login":"openqubit"}}