passport.use(new JwtStrategy(opts, function (jwt_payload, done) {
UserModel.findOne({ id: jwt_payload.id }, function (err, user) {
if (err) {
return done(err, false);
}
if (user) {
return done(null, user);
} else {
return done(null, false);
// or you could create a new account
}
});
}));
I have this code with me , how do i write in typescript , what do you guys do . I know typescript but i feel that there are many places i will miss typesafety
0 Replies
No replies yetBe the first to reply to this messageJoin