Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meldDBCallback confussion #39

Open
ghost opened this issue Jan 20, 2016 · 2 comments
Open

meldDBCallback confussion #39

ghost opened this issue Jan 20, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2016

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
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant