javascript - How is this passportjs code working? -


i begineer in nodejs. reading passport.js codes , bit confused code

app.post('/login',  passport.authenticate('local'),  function(req, res) {  // if function gets called, authentication successful.  // `req.user` contains authenticated user.  res.redirect('/users/' + req.user.username);  }); 

i comparing above codes codes below

app.get('/', function (req, res) {  res.send('hello world')  }) 

app.post() has 3 arguments. seeing 2 arguments cannot understand 1 additional argument passport.authenticate('local'), can me


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -