changed login to ajax added error message for incorret login, closes #36

This commit is contained in:
Baris Soner Usakli
2013-06-25 20:55:02 -04:00
parent 8e10ce1924
commit 9b43f80ff8
4 changed files with 40 additions and 7 deletions

View File

@@ -129,10 +129,9 @@
});
app.post('/login', passport.authenticate('local', {
successRedirect: '/',
failureRedirect: '/login'
}));
app.post('/login', passport.authenticate('local'), function(req, res) {
res.json({success:1});
});
app.post('/register', function(req, res) {
user_module.create(req.body.username, req.body.password, req.body.email, function(err, uid) {