This is a very nice solution and API for the front-end. It took me a couple part-time months to put together a similar (not modularized) solution for a rewrite of Plunker. There is quite a bit of juggling of information to do to pass around the appropriate information between client, server and auth providers that seems to have been nicely abstracted. There were three major challenges for me in my implementation and…
The account merging part is something your server should handle. In my app I maintain a users table that has columns (google_account_id, facebook_account_id, twitter_account_id, etc), pointing to individual rows in a separate accounts tables (e.g. google_accounts, facebook_accounts, twitter_accounts etc). When a user adds an existing account_id, I take care of merging the two different users rows, populating appropri…
https://github.com/intridea/omniauth/wiki/Managing-Multiple-...
Use what works for you obviously, but this would have the benefit of scaling easier if you end up ever needing to support additional providers.