简体   繁体   中英

Do I need a separate table for facebook login?

My website has a normal login function. And I want to add another login via facebook api. So do I need a separate table to store facebook data or can I use same table which holds user registration data?

The social media api's return user data, so you could use that data to first check on your database users table whether that user's record exists using the uniqueUserId provided by the api, if not you create a new record.

Example, Github API might return something like;

{
    gitHubUserId: 123456,
    username: 'Github Username',
    email: 'user@gmail.com'
}

Hope that sheds some light.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM