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 - How to display all orders for a single product showing the most recent first? Woocommerce -

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

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -