jaredhanson / passport-local

Username and password authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-local/?utm_source=github&utm_medium=referral&utm_campaign=passport-local&utm_content=about
MIT License
2.73k stars 497 forks source link

`deserializeUser` is not called when session was not found in DB. Is it correct behavior? #161

Open wzup opened 6 years ago

wzup commented 6 years ago

I discovered that deserializeUser is not called if session was not found in a DB by express-mysql-session. Is it correct behavior?

Use case:

I'm using passport-local with session = true and with express-mysql-session as a session store. When session is ok (found by express-mysql-session in a DB) then deserializeUser is called all right. However if a session for some reason isn't found in a DB (eg. session cookie is manually deleted in a browser or a session row is manually deleted from DB) then deserializeUser doesn't get called. Why? Is it correct behavior?