Monday, 27 January 2020

How do you handle storing ids of Passport.js strategies, when using multiple strategies?

I want to use multiple strategies (local, google, facebook, twitter) and I am aware that passport.js returns an id from the service the user has chosen to sign in on.How do you handle this in your databases?Can I use the id returned from passport.js as the primary key of my users table or will there be collisions?Is it a bad idea to just have a strategy_id field in my users table, without storing which strategy it comes from?At the moment I'm thinking of having a user table, a login_strategy table (id, strategy_type) and a user_login_strategy table that relates the two tables.

Submitted January 27, 2020 at 08:12PM by SweatyHands247

No comments:

Post a Comment