Work with users that exist, but try logging in via Facebook OAuth / etc

I have a decent set of existing users on my website who access their email address through their email address.

I am setting up the Facebook OAuth mechanism to allow new users to register more conveniently, but I'm not sure how to handle the scenario when a user who already has an email address registered in our system and is now trying to log in via Facebook.

  • Should I consider him to be the same user?
  • Should I treat him as a new user?

The situation is complicated by the fact that I do not check my email addresses (when they enter the system directly into my system), so I can not assume that they are the same user.

How do others resolve this conflict, or do other people just access this user with FB as a new object?

+3
source share
2 answers

On the login screen, users can have a choice: you can put

  • new user: register using facebook

since this is a completely new user account, you just need to make your request on facebook + request for email, etc.

  • existing user: email login

, , . , , facebook. , , facebook.

, , user_accounts, facebook_user_id fb_id user_id, .. facebook connect, , UPDATE table SET fb_id = xxx WHERE email = xx

+1

. , (Facebook Connect), .

, , ( , ), , .

(Google OAuth, Facebook ..), , .

, , , , " ", , , .

0

All Articles