Hi, I want to use passport.js with Twitter and Instagram, so that a user can login with neither, either, or both of these, and the login info will persist inside 'user'. Currently, it overwrites the currently logged in strategy when you log in to another, but I want to remember all the responses/details for all strategies. I am attempting to complete this without any use of databases.I am currently doing this:passport.use(new TwitterStrategy({ ... })); passport.use(new InstagramStrategy({ ... }) }); passport.serializeUser(function(profile, cb){ cb(null, profile); }); passport.deserializeUser(function(object, cb){ cb(null, object); }); // then login like: app.get('/tw/login', passport.authenticate('twitter')); app.get('/tw/cb', passport.authenticate('twitter', { failureRedirect: "/" }), function(request, response) { response.redirect("/"); }); app.get('/ig/login', passport.authenticate('instagram')); app.get('/ig/cb', passport.authenticate('instagram', { failureRedirect: "/" }), function(request, response) { response.redirect("/"); }); Does anyone have any ideas of how I can fix this?
Submitted April 16, 2019 at 11:12PM by 360nuddscope
No comments:
Post a Comment