Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge Twitter and Facebook accounts in Meteor user doc

Tags:

meteor

So I'm building out an app with Meteor and noticed when I log in with Twitter and then Facebook, I create two separate user accounts. Is there any built in way to make sure these are merged? I'm not seeing any email address in the twitter based user account, so I can see it might be difficult to figure out which accounts to link.

Suggestions? Thanks!

like image 550
Shane Reustle Avatar asked Apr 26 '13 06:04

Shane Reustle


1 Answers

I've been in a similar situation so here's a good starting point for you:

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

  • Do a mandatory protocol / routine to save the email in some profile field in any authentication method as much as possible, so that you are able to do the next step, which is..

  • Whenever another authentication method is used (to create the user), you can compare the existing database of users (now confident that an email field would be present at all times to check against), and do the merge whenever an exact email match happens.

It's a shame I do not have the code now because I tried this protocol once, but I quickly decided that I'll just stick with one authentication method for some reason. Maybe I'll update this answer when I can get around to try and code that again.. or maybe not.

like image 119
Seth Malaki Avatar answered Oct 08 '22 05:10

Seth Malaki