June 2014
Intermediate to advanced
696 pages
38h 52m
English
You need to register Passport in the middleware service by using the initialize() method of the Passport NPM. This configures the Passport strategies and hooks them into the Express middleware mechanism. For example:
app.use(passport.initialize());
If you want to store the authentication in sessions, you also need to register the passport.session() middleware. You must do this after the expressSession() middleware if you are doing both. For example:
app.use(expressSession({ secret: 'SECRET' }));app.use(passport.initialize());app.use(passport.session());
Read now
Unlock full access