Implementing Application Middleware

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());

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.177.115