I'm creating my first application in NodeJS and managed to structure the application, connection, directory structure, routes, anyway, everything working fine.
Now I've implemented the login system and I've already encountered an error in passing parameters to passport.use(new LocalStrategy(function(email,password,done)){});
.
I'm trying to call two properties passed as parameters, but it's giving error:
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var userService = {
//Se eu der um console.log() aqui, aparece os valores passados.
login: function(email,password) {
//O problema está aqui, quando tento passar o email e o password como parâmetro.
passport.use(new LocalStrategy(function(email, password, done) {
console.log(email); //Aqui não imprime mais
});
},
}
Could you help me figure out how to pass the parameter into passport.use
?
Thank you in advance.