Bad Request when signing in with Passport, Express and NodeJS

1

I am trying to authenticate a system but whenever I try to login (post) I get an error:

  

400 (bad request).

The console displays the message:

  

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use the byte order mark as an encoding signature .

This is my route that receives the POST login

router.post('/',
  passport.authenticate('local'),
  function(req, res) {
    res.json({ currentUser: req.user });
    //console.log(req.body);
    //res.redirect('/');
  }
);
    
asked by anonymous 21.08.2015 / 16:19

0 answers