I am using Passport-Local (https://github.com/jaredhanson/passport-local) to authenticate with node.js. So far, this example works like a charm, as users register on the post-webform blog:
app.post('/login',
passport.authenticate('local', { failureRedirect: '/login', failureFlash: true }),
function(req, res) {
res.redirect('/');
});
Now, however, I want to copy the JSON-based API to authenticate users by calling a specific URL. However, changing the code code to app.get(…does not work.
Any tips?
source
share