What is the difference between req.user and req.body.user in express code?

  node.js, question

For example, the following code

 { successRedirect: '/',
 failureRedirect: '/login',
 failureFlash: true }),
 function(req, res) {
 //Call this callback function if verification is successful
 Res.redirect('/users/' plus req.user.username);

There is no req.user in express’s req. The req.user.username here should be attached to the REQ object in passport’s authenticate method. Please check your passport source code for details.
Req.body.user refers to the user parameter in the post request, that is, the value submitted to the server by a user input box whose name is in your html form page. If the body-parser middleware is used, the user parameter in req.body can be obtained.