splendido / meteor-accounts-meld

Meteor package to meld user accounts registered with the same email address, or associate many different 3rd-party login services with the same user account.
http://test-accounts-meld.meteor.com/
98 stars 26 forks source link

meldDBCallback confussion #39

Open ghost opened 8 years ago

ghost commented 8 years ago

This is a great and comprehensive package - thanks for all your work.

I have an issue in my application where members may belong to various groups. If someone has signed up with a service (like Facebook) and joins a group, their user_id is used as their memberId in the Members collection. Then if the same person registers (new registration) with their email address with a verification email, the accounts-meld works great - but I want to be able to change their memberId in the Members collection using the MeldDBCallback function, and I can't seem to get it to work (the Members.update doesn't happen).

I followed the documentation as follows: var meldDBCallback = function(src_user_id, dst_user_id){ Members.update( {MemberId: src_user_id}, {$set: {MemberId: dst_user_id}}, {multi: true} ); };

AccountsMeld.configure({ meldDBCallback: meldDBCallback });

What am I missing? Any help would be greatly appreciated - thanks, Bob

ujwal-setlur commented 8 years ago

I am seeing some issues as well. meldDBCallback is not always called. When I sign in first with Google, and then with Facebook, the accounts get melded, but the callback function is not called. When I sign in natively with user name/password, then the meldDBCallback is called. Am I missing something?

ujwal-setlur commented 8 years ago

Actually, I just noticed that when I signed in first with Google, and then with Facebook, the user ID did not change! The facebook service was just added to the existing account, so no melding was actually done, so no callback. I think this is the way it should work, but it was not expected since I thought the new account would always take over.