Answers for "(node:18403) UnhandledPromiseRejectionWarning: Error: passport.initialize() middleware not in use"

1

passport.initialize() middleware not in use

its because you have declared the middleware after you have intialised the routes 
in the index file
the correct order is
app.use(passport.initialize());
app.use(passport.session());
app.use(passport.setAuthenticatedUser);


app.use('/', require('./routes'));
Posted by: Guest on November-26-2020

Code answers related to "(node:18403) UnhandledPromiseRejectionWarning: Error: passport.initialize() middleware not in use"

Code answers related to "Javascript"

Browse Popular Code Answers by Language