everybody
I am working on an application which is using IBM db2 as database and using passport js for authentication purpose.
so my question is how do i compare the values which are coming from login form to that which are stored in database.
passport.use(new LocalStrategy({
usernameField: 'euser',
passwordField: 'epass'
},
function(username, password, done){
process.nextTick(function() {
/* how do i open connection to db2 and compare username and password
with the data stored in database? */
});
}
));
how do i open connection to db2 and compare values in order to authenticate user and start session.
Taken from the passport.js docs; for example sake, change the usernameField to username, passwordField to password. You could probaly switch the User object with the variable assignments for login results with database results if you so desire.
.... // the above is passed as arguments to the function(username, password, done) {