What if a particular user (John Doe)wants to be funny by registering with different social media accounts like using both Facebook and Google thereby having 2 accounts. how will you handle it and ensure the user (John Doe)is not a multiple users.
@angelukpong In order to handle with this scenario, you will have to consider for both social media accounts there should be the same Email Address because through the name only, we can consider unique user (John Doe) whether this is registered by Facebook and Google. Also, while proceeding with the social login, you will have to check by email address field instead of provider unique id. If that email exists (no matter if it is registered using Google or Facebook) you will have to consider that user exists then simply make it auth login.
@@programmingfields i login with facebook just like you do and my database have the info for that user then i delete that user data in my database then run again login with facebook with that user i click continue and i got the error that i cant get email from that user it return null for field email,what should i do to fix this error
@@tripham7136 The issue you're facing happens because Facebook may not give the email if: 1. You have removed your app's permission to access the email. 2. Your app didn't ask for permission to access the email. 3. The email was previously retrieved and then removed from your database, so Facebook doesn't send it again. To fix this, make sure your app is asking Facebook for the email permission when the user logs in. If that permission is missing or revoked, Facebook won't give you the email.
Thank you
@anthonytang7346 You're welcome.
It's probably better to check for both the email and provider_id in the db before registering. Checking only the ID might not be safe.
@@vircheous Yes, we can add that check as well. That's only for the demo purposes.
I will plead you to also do videos on Alpinejs and Tailwind CSS. Thanks for your great help.
@angelukpong Thank you very much for your suggestion. I will start a new playlist very soon. Please be patient.
What if a particular user (John Doe)wants to be funny by registering with different social media accounts like using both Facebook and Google thereby having 2 accounts. how will you handle it and ensure the user (John Doe)is not a multiple users.
@angelukpong In order to handle with this scenario, you will have to consider for both social media accounts there should be the same Email Address because through the name only, we can consider unique user (John Doe) whether this is registered by Facebook and Google.
Also, while proceeding with the social login, you will have to check by email address field instead of provider unique id. If that email exists (no matter if it is registered using Google or Facebook) you will have to consider that user exists then simply make it auth login.
When i hit cancel i get error why
@gurmeetsingh-by1in what kind of error you are getting?
@@programmingfields i login with facebook just like you do and my database have the info for that user then i delete that user data in my database then run again login with facebook with that user i click continue and i got the error that i cant get email from that user it return null for field email,what should i do to fix this error
@@tripham7136 The issue you're facing happens because Facebook may not give the email if:
1. You have removed your app's permission to access the email.
2. Your app didn't ask for permission to access the email.
3. The email was previously retrieved and then removed from your database, so Facebook doesn't send it again.
To fix this, make sure your app is asking Facebook for the email permission when the user logs in. If that permission is missing or revoked, Facebook won't give you the email.