I think there is an error in the following line in the passport.js file:
return UserModel.findOneById(jwtPayload.id)
I'm almost positive (I'm still learning though) there is no findOneById() function. This throws an "findOneById() is not a function" error. It worked for me when I switched it to findOne()
There's also something wrong with the quote marks in this line in theroutes/auth.js file:
const passport = require("passport”);
The first quote mark is Unicode Character U+0022
The second one is Unicode Character “”” (U+201D)
I think there is an error in the following line in the passport.js file:
I'm almost positive (I'm still learning though) there is no findOneById() function. This throws an "findOneById() is not a function" error. It worked for me when I switched it to findOne()
There's also something wrong with the quote marks in this line in theroutes/auth.js file:
The first quote mark is Unicode Character U+0022
The second one is Unicode Character “”” (U+201D)
On the newer version the findOneById was deprecated, but when the article came out it was still in use.