passport-local-sequelize
passport-local-sequelize copied to clipboard
HOW DO I CREATE MULTIPLE CONFIG FOR SAME TABLE
I have 2 user admin and public users stored in the same table
i want to log in to both users with different username fields.
how do I configure with admin-strategy?
I have tried Folwing code but no luck:
For admin LocalStrategySequelize.attachToUser(db.user, { usernameField: "email", hashField: "hash", saltField: "salt", });
For user LocalStrategySequelize.attachToUser(db.user, { usernameField: "contactNumber", hashField: "hash", saltField: "salt", });
passport.use(db.user.createStrategy()); passport.use("admin-strategy", db.user.createStrategy());