Monday 30 July 2018

Passport.js: two strategies, serializing/deserializing twice. Can't get to use both strategies but only one.

So I've been spending the past few days trying to understand why the hell I couldn't keep an user logged in once authenticated even though authentication itself was working.By trying to fix the issue for hours, I finally got what's wrong.The issue is the following: I have two different passport strategy, so I am serializing and deserializing the user twice. If I serialize the user with the local strategy first, local strategy will work, but google's won't. And viceversa.I put a comment to highlight the problem in app.js.You can find the code here: https://ift.tt/2Apyibj knows how to solve this? I've literally been stuck with this for days and I've finally come close to a solution, but I can't seem to find it.

Submitted July 30, 2018 at 08:49PM by mindnoot

No comments:

Post a Comment