issue #136 - login redirects

Fixing logical error if there is no redirect
Also removing console log
This commit is contained in:
Hannah Wolfe 2013-06-25 21:06:50 +01:00
parent 0973002b71
commit 2a7423c620

View File

@ -67,9 +67,8 @@ adminControllers = {
},
'auth': function (req, res) {
api.users.check({email: req.body.email, pw: req.body.password}).then(function (user) {
console.log('user found: ', user);
req.session.user = "ghostadmin";
res.redirect('/ghost/' + req.query.r || '/ghost/');
res.redirect(req.query.r ? '/ghost/' + req.query.r : '/ghost/');
}, function (error) {
// Do something here to signal the reason for an error
req.flash('error', error.message);