passport / discuss

A forum for discussing topics related to the usage of Passport.js.
1 stars 0 forks source link

Migrate from 0.4.1 to 0.5.0 - req.logIn is not a function #56

Open julianfox opened 3 years ago

julianfox commented 3 years ago

Hello, Is there a doc to migrate from 0.4.1 to 0.5.0? Or should we rebuild the implementation from scratch?

I got the following error after the update: req.logIn is not a function at Strategy.strategy.success (node_modules/passport/lib/middleware/authenticate.js:247:13)

jaredhanson commented 3 years ago

There shouldn't be any changes that require migration. If you are getting this error, double check that passport.initialize() middleware is use()d prior to any routes which have passport.authenticate() middleware. See here for an example: https://github.com/passport/express-4.x-local-example/blob/master/app.js#L36