According to my scenario, when the user signsup, he will get an SMS where he'll have to enter it to the application. At this point I will consider that the user is authenticated. I am using passport.js
for this purpose. My code is given below. I have remove the authenticating via SMS code to keep this simple. When the code is executed I get a 400
error message. How can i solve this ?
var express = require('express');
var router = express.Router();
var csrf = require('csurf');
var passport = require('passport');
var csrfProtection = csrf();
router.use(csrfProtection);
var fs = require('fs');
var ejs = require('ejs');
router.post('/confirmationsignup', passport.authenticate('local'), function(req, res) {
user.confirmSignUp(params, function(err, data) {
if (err) res.redirect('a/asa');
});
});
module.exports = router;