Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow to link a provider account (facebook, twitter, etc.) when the user is logged. #160
Currently links a provider account when creating a user from an external provider. This is fine for a first user registration. But if I already created an account from Facebook, and I need to link my Twitter account I can not.
This is useful because it allows the user to link your other accounts. And then I could login from any of them.
I also think that this would benefit from some redesign. Right now, each account is a separate account. If you log in with a password, or via Facebook, or via Twitter, its three separate accounts. A way to link them, or to provide alternate logins for the same account would be better.
Also, under the current method an additional table is used. This is annoying because the method only involves two fields which are currently on a one to one relationship with the user account. (That is the authentications table stores two fields for each record and each record relates to one and only one user record.) It would be more convenient to have that information directly in the user record.
However, if you move to a multiple oauth type system per user then the extra table is necessary, as it is then one user to many third-party accounts.
I was thinking of maintaining the table structure and providing a method to 'link' an account. I've started on it, and it works. But, I still need to add tests, etc.
Other projects have taken my focus away from this for the time being, nothing worth sharing yet.
I'm trying to decide how to best fit it in with Sorcery's API. I think I'll add the method:
I also am thinking about
Which would handle those checks for you.
I'll try to do more with it today and get something up for everyone.