-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Multiple social account for same user #1681
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
Comments
Hey! I had the same problem, not an expert but I was able to solve it this way (feel free to correct me) First, be sure to use auth.isAuhtenticated() in the route.
then later in facebook/passport.js
|
OMG! I love you! |
I really think this could be part of the core |
There is a caveat to this case: with a FB or a Google strategy, you will have a verified email, with a local strategy the email won't be verified and with Twitter you won't have an email at all. Linking an FB account with an unverified local account will bring some security issues along. |
yes, it's true. Interesting point.
|
Cool! I'll give a look at it! |
@miguelalche maybe I'm wrong but with your solution you actually pass to facebook your user. Am I wrong ? |
@gpessa Glad it could help! 😄 |
Sorry. So, you copy the user into the request and you send it to Facebook. That means that Facebook can read it. |
What happen with the passport Facebook authentication is this:
Between the 1 and 2 you attach your user info to the request. |
This is one of the cases when helping others ends up heping you! |
Duplicate of #359 |
@miguelalche Just to clarify- this approach requires the user to be logged in with the local provider in order to attach Facebook to the local user. What if the user doesn't have an account with local and wants to create one. What is your recommended approach instead of checking if isAuthenticated as the middleware? |
I know I'm not the first one asking for it but I still try :)
I spend my last week trying to solve this problem but I can't find a solution.
I created a new route to connect to the current account another one but in the callback i always have the req.user empty and I can't figure out why.
Please help us :)
The text was updated successfully, but these errors were encountered: