nicolaslopezj / meteor-apollo-accounts

Meteor accounts in GraphQL
MIT License
146 stars 37 forks source link

[loginWithFacebook]: Need better return value (was account created or not?) #64

Open joncursi opened 7 years ago

joncursi commented 7 years ago

After lots of testing, I have come to the conclusion that loginWithFacebook isn't exactly just "login with Facebook". It does two things:

1) If you don't already have an account, it will CREATE an account for you and then sign you into it. So in a sense, this is actually signUpWithFacebook followed by loginWithFacebook. 2) If you already have an account, then it will log you into it. This is where the loginWithFacebook name is appropriate.

In my app, I am trying to decide when the user goes through the loginWithFacebook process if they are:

A) creating a new account (aka signUpWithFacebook), or B) logging in to an existing account (aka loginWithFacebook).

However, the method provided by this package does not give the necessary information to be able to figure this out on the client. All I get in response is the user's ID, but I don't know if the ID was just created or if the ID is an existing ID that was created previously.

My app needs to know this information so that it can send the user to the appropriate screen (i.e. sign them into the dashboard for loginWithFacebook versus walk them through the onboarding process for signUpWithFacebook).

Thoughts?