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

Possible to allow melding of multiple same service different accounts? #10

Open
markudevelop opened this issue Dec 21, 2014 · 10 comments
Open

Comments

@markudevelop
Copy link

hello splendido! I really need the option to allow connect multiple accounts of same social network for example connect 3 different Facebook accounts just make them available in the Meteor.user() services collection. Is it hard to accomplish is there any issues with that? It's basically for API calls (not for FB). Thanks

@splendido
Copy link
Owner

Yeah, unfortunately this is not possible at the moment, unless we rewrite all accounts packages from Meteor core.

See for example this line and this line from the method used to find the user to which a service is linked. The selector used suppose you have the usual structure inside the user object:

{
  ...
  services: {
    password: { ... },
    facebook: {
      id: 'asldknijasf,.naflk',
      ...
    },
    google: {
      id: 'asadsasdaflkhgf',
      ...
    },
    ...
  }
}

The only solution, IMHO, should be to not relay on the original updateOrCreateUserFromExternalService method and roll our own one to be used here.
The services object should be then changed to keep an array of objects for each service like this:

{
  ...
  services: {
    ...
    facebook: [
      { id: 'asadsasdaflkhgf', ... },
      { id: 'opsdnsdhansah', ... },
      { id: 'qwpodmcsaalm', ... },
    ],
    google: [...],
}

...but then we'll also have to add new indices on the users collection drawing this one completely unuseful (hoping it's not going to make problems with the new array structure...)

I think I'll open a new thread about this here
This is anyway worth investigating!

Tnx

@mitar
Copy link

mitar commented Dec 21, 2014

+1

@Sivli-Embir
Copy link

+1 for some solution but changing the core user structure worries me. This would make any additional user packages unusable. Would it be better to leave the current object structure and use it to identify a 'primary' account? We could have a user.meldServices.facebook = [] structure in the background and one of those marked a primary, which would also be in user.services.facebook = {}.

@markudevelop
Copy link
Author

@Kestanous Yeah why the hell not can't this be done separately?

@splendido
Copy link
Owner

we'll have to change the selector to find the user to be associated to the current log in attempt anyway...
...I guess if MDG changed the underlying structure everything might turn out to be easier.
and the primary account for each service might be marked by using an additional field inside the service object.

but I agree it will be a breaking change!

In any case I guess we'll have to roll our own solution, so if you think with some more effort we can do a separate tracking while not breaking most of the current packages, we'll go for it I guess!

...but then I already see someone asking to change the default facebook profile, which will require moving services object from one list to the other and stuff like this ;-)

@mitar
Copy link

mitar commented Dec 22, 2014

I would prefer to have one list and order of accounts in the list signify importance of the account.

We could simply create a separate accounts system with other schema.

@Sivli-Embir
Copy link

Really my concern is lets not split the community. Convincing MDG to fix users would be the ideal. We can all change our packages but we should be in agreement with how things should work.

@splendido
Copy link
Owner

Could you all please report your comments also on the above cited issue @ MeteorCommunity?

@markudevelop
Copy link
Author

@Kestanous my observations that MDG doesn't really take users opinions very seriously I didn't see any requests being answered so I think there is no much choice...

@Sivli-Embir
Copy link

@voidale and thus my array + primary recommendation :/ Its not great but IMO it's better the full community split.

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

4 participants