當我成功使用護照JS登錄時,發生此錯誤。嘗試一次我登錄,做它護照JS「發送後無法設置標題」
代碼重定向到主頁:
app.post('/login',
passport.authenticate('local', {failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
完全錯誤:
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:644:11)
我缺少的東西?不知道爲什麼這個錯誤發生。我仍然能夠使用該應用程序,我只是不想錯誤。
謝謝,我打電話完成()兩次 – wesbos
感謝你。在意識到你需要'其他'之前,我做了很多頭部劃傷。順便說一句好用戶名和頭像。 – electrichead