Tuesday, 16 May 2017

Error:400 Bad Request

routes.js

//require the passport strategy from the folder in the project.
  var passport = require('passport');
  var x = require('./usefile/file');

var requireLogin = passport.authenticate('login',{session: false});

module.exports = function(app){

var auth = express.Router();

app.use('/api/auth', auth);

auth.post('/login', requireLogin, function(req, res){
     x.login(req, res)});
}

Note: My code is not using the requireLogin which is used to authenticate from the passport, So it is showing 400 bad request error.

Please help.



via Aditya Jain

No comments:

Post a Comment