Fixed "Cannot read property 'redirect' of undefined"

master
Keith Irwin 2017-04-16 16:53:58 -04:00
parent 1988047e74
commit f3b832d2ed
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ module.exports = (app, passport) => {
// Login/-out
app.route('/login')
.get( (req,res)=>{
if (req.isAuthenticated()){ loginCallback(); }
if (req.isAuthenticated()){ loginCallback(req,res); }
else { res.render('login'); }
})
.post( passport.authenticate('local',loginOutcome), loginCallback );
@ -160,7 +160,7 @@ module.exports = (app, passport) => {
// Forgot password
app.route('/login/forgot')
.all( (req,res,next)=>{
if (req.isAuthenticated()){ loginCallback(); }
if (req.isAuthenticated()){ loginCallback(req,res); }
else { next(); }
} )
.get( (req,res,next)=>{