may have fixed email forms

This commit is contained in:
Michael Q Larson
2014-11-30 00:10:21 -08:00
parent 6a0b6bb315
commit abeebb9991
3 changed files with 8 additions and 16 deletions

View File

@ -88,7 +88,7 @@ exports.postSignup = function(req, res, next) {
if (errors) {
req.flash('errors', errors);
return res.redirect('/signup');
return res.redirect('/login');
}
var user = new User({
@ -99,7 +99,7 @@ exports.postSignup = function(req, res, next) {
User.findOne({ email: req.body.email }, function(err, existingUser) {
if (existingUser) {
req.flash('errors', { msg: 'Account with that email address already exists.' });
return res.redirect('/signup');
return res.redirect('/login');
}
user.save(function(err) {
if (err) return next(err);