How to check if a user has registered an account on the website using social login information

59 Views Asked by At

I want to integrate Facebook social login into my website, but how can I accurately check if that Facebook account has been registered on my website or not?

For example, I have a developer account: developer01. I used this account to create an App ID and Secret Key for the login process.

Now there is a user named user01 who logs in to my website using their Facebook information: ID: 01234 Email: [email protected]

If I use the ID to check if the user has registered or not, then if my developer account (developer01) encounters any issues, I will have to switch to another developer account (developer02). At that time, when the user logs in again, the ID will no longer be 01234 but a random number. As a result, the user's data will be lost even though they have logged in with their Facebook account.

If I use the Email to check if the user has registered or not, then if the user changes their email on Facebook, the email I get from Facebook will be different. This will also cause data loss.

So, what should I do in this situation?

0

There are 0 best solutions below