Cannot set headers after they are sent to the client

后端 未结 1 399
日久生厌
日久生厌 2020-12-11 13:42

Cannot set headers after they are sent to the client. This is my back-end side error after authentication post request.It looks like problem with headers. I\'m sorry for my

相关标签:
1条回答
  • 2020-12-11 13:45

    This is due to your code trying to send multiple responses from the authenticate function.

    res.json ({ success: true, token: 'bearer ' + token }); // 1st Response
    res.redirect("/users/user"); // 2nd Response
    

    Remove one of them which you don't use.

    0 讨论(0)
提交回复
热议问题