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

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -