I am trying to integrate passport to my code\'s login form. Client side calling server side works as it should until i call passport.authenticate in the request, 400 Bad Request
This error also comes from trying to access the HTML DOM elements without using body-parser
body-parser is a module that let's you traverse the html document tree to read response especially in case of input fields
Use -
var parser = require('body-parser');
var urlencodedParser = parser.urlencoded({extended : false});
app.post("/authenticate", urlencodedParser, passport.authenticate('local'), function (request, response)
{
response.redirect('/');
});