Answer the question
In order to leave comments, you need to log in
How to correctly check if a user is logged in to passport-jwt?
passport.use(new JwtStrategy(opts, function(jwt_payload, done) {
User.findUserById(jwt_payload.id)
.then(function(user) {
return done(null, user);
})
.catch(function(err){
return done(err, false);
})
}));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question