passport.deserializeUser not called when session uses external session storage
See original GitHub issueIf koa-session is initialized with external sotage (not cookies), then passport.deserializeUser will be never called. As a result method isAuthenticated will never work as expected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (5 by maintainers)
Top Results From Across the Web
deserializeUser not called when user session shared ... - GitHub
I'm trying to deserialize users and authenticate them on my wiki app localhost:8000, when they are logged in with passport on my main...
Read more >PassportJS deserializeUser never called - node.js
Have you use() 'd passport.session() middleware? Like in this example: ... Apparently in this case req.login() will not be called (which calls deserialize)....
Read more >Passport.js - Documentation
When the session is authenticated, Passport will call the deserializeUser function, which in the above example is yielding the previously stored user ID, ......
Read more >How to use the passport.initialize function in passport - Snyk
sync(); // First, our session middleware will set/read sessions from the request. // Our sessions will get stored in Mongo using the same...
Read more >The Ultimate Guide to Passport JS - DEV Community
Session Based Authentication - Utilizes browser Cookies along with backend "Sessions" to manage logged-in and logged-out users.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I switch to
koa-session-minimalandkoa-redis, and keepkoa-passport, and then the problem resolved.so I think this problem may be caused by
koa-sessionlib.I’m a bit late to the game here, but I was having this same issue where passport.deserializeUser was never called when using an external store with koa-session and koa-passport. The unfortunate cause of my struggles was not realizing that I had to store the entire sess argument instead of just the unique key within it that I was interested in. I blame that on poor documentation…
If anyone else hits this, I wrote this minimal working memory store that you can drop in for debugging to verify that it is your store implementation that has the problem and not koa-session or koa-passport.