I have defined in passport.js file a function called issueToken(user, done). In server.js I have the following code:
require('./config/passport')(passport);
require('./app/routes.js')(app, passport);
In routes.js, I am trying to call the issueToken function:
module.exports = function(app, passport) {
...
passport.issueToken(req.user, function(err, token) {
...
}
}
However it seems it is not the correct function call since it returns the following error: TypeError: undefined is not a function at Object.handle (/home/octavian/Desktop/node/login2/app/routes.js:54:12) (the line containing the issueToken function call above).
Any clues on what is the correct syntax for the call I'm trying to make?
Thanks