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
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.