Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Please mention passport.deserializeUser in readme file #139

Open
nikhilsarvaiye opened this issue Jul 12, 2017 · 2 comments
Open

Please mention passport.deserializeUser in readme file #139

nikhilsarvaiye opened this issue Jul 12, 2017 · 2 comments

Comments

@nikhilsarvaiye
Copy link

Hi team,

I have seen alot of users face ""Passport was not initialized"" issue, when they implement custom strategy.
Sometime, user don't implement and passport.serializeUser and passport.deserializeUser methods

also, req.login is required for it to get call.

Request you do please update read me, where express session is getting updated with passport user values.

@jfromaniello
Copy link
Owner

you don't have to implement serializeUser/deserializeUser in your custom strategy.. You have to add the passport.session() middleware, if you don't add that middleware you can't use this module.

Maybe we should improve the error message?

@nikhilsarvaiye
Copy link
Author

Yes, error meesage is not useful.

i have already added passport.session().
But after only calling req.login() in my api, it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants