【发布时间】:2019-03-28 13:18:03
【问题描述】:
谁能解释一下我们在passport.authenticate的末尾包含什么以及为什么要包含(req,res,next),到目前为止我在教程中看到的只是我们需要它,因为我们希望它触发立即关闭,但我真的不明白。
代码如下:
router.post('/login', (req, res, next) => { <br>
passport.authenticate('local', { <br>
successRedirect: '/songs/list', <br>
failureRedirect: '/users/login', <br>
failureFlash: true <br>
})(req, res, next); <---- *This line*
【问题讨论】:
标签: node.js authentication passport.js passport-local