Combine Twitter and Facebook Accounts in a Custom Meteor Document

So, I am creating an application with Meteor and noticed when I log in with Twitter and then Facebook, I create two separate user accounts. Is there a built-in way to make sure they are combined? I don’t see the email addresses in the Twitter user account, so I can see that it can be difficult to determine which accounts to contact.

Suggestions? Thanks!

+6
source share
1 answer

I was in a similar situation, so here is a good starting point for you:

You might want to merge in the Accounts.onCreateUser event. Basically what you would do at this time:

  • Make the required protocol / routine to save the email in any profile field in any authentication method, as far as possible so that you can take the next step that ...

  • Whenever a different authentication method is used (to create a user), you can compare the existing user database (now you are sure that the email field will always be present to check), and merge the exact match of the email every time.

I am ashamed that I don’t have the code now, because I tried this protocol once, but I quickly decided that for some reason I was just using a single authentication method. Maybe I will update this answer when I can get around to try again, or maybe not.

+2
source

Source: https://habr.com/ru/post/943676/


All Articles