{"action":"opened","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/7213","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/7213/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/7213/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/7213/events","html_url":"https://github.com/meteor/meteor/issues/7213","id":160209529,"number":7213,"title":"Add a onUpdateUser hook to the accounts-base package","user":{"login":"FGM","id":143311,"avatar_url":"https://avatars.githubusercontent.com/u/143311?v=3","gravatar_id":"","url":"https://api.github.com/users/FGM","html_url":"https://github.com/FGM","followers_url":"https://api.github.com/users/FGM/followers","following_url":"https://api.github.com/users/FGM/following{/other_user}","gists_url":"https://api.github.com/users/FGM/gists{/gist_id}","starred_url":"https://api.github.com/users/FGM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FGM/subscriptions","organizations_url":"https://api.github.com/users/FGM/orgs","repos_url":"https://api.github.com/users/FGM/repos","events_url":"https://api.github.com/users/FGM/events{/privacy}","received_events_url":"https://api.github.com/users/FGM/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T15:20:46Z","updated_at":"2016-06-14T15:20:46Z","closed_at":null,"body":"## Problem to solve\r\n\r\nSince commit 00eda434206aba34e91ccde25019c2b035b3c746 (OAuth login to an existing account now *does* update the services.PROVIDER), `accounts-server.js` contains mention of a `onUpdateUser` hook remaining to be implemented, in function `updateOrCreateUserFromExternalService()`. Still present in the `release-1.4` branch\r\n\r\n## Why this is a problem\r\n\r\nIt turns out this hook is missing in an accounts package for transparent Drupal authentication I've been developing (https://github.com/FGM/accounts-drupal) : due to this missing hook, when Meteor is notified about a change in the user exported information, the info is properly merged to the database under the `services` key for the user, but the `profile` field cannot be updated.\r\n\r\nThis appears to have been the reason for the mention about that hook in the first place: \r\n\r\n>  XXX provide an onUpdateUser hook which would let apps update the profile too\r\n\r\n## Current workaround\r\n\r\nThe current workaround is to delete the user and relog them, which causes the the profile to be regenerated as it should, but means any work in progress by the user is lost while they are logged out.\r\n\r\n## Suggested solution\r\n\r\nImplement such a hook. If MDG is willing, I could probably submit a PR to do so.\r\n\r\nNote: one similar hook was added recently on logout in #6889, so adding its equivalent for updates seems just a consistency measure."}}
{"actor":{"display_login":"FGM"}}