this weird one. im passport's 'local strategy' express app , i'm running odd issue. essentially, have 3 routes. each have auth check in place. app.get('/admin', authenticatedornot, adminroute.index); app.get('/admin/new', authenticatedornot, adminroute.newpost); app.post('/admin/new', authenticatedornot, adminroute.create); the authenticatedornot method : var authenticatedornot = function(req, res, next){ if(req.isauthenticated()){ next(); }else{ res.redirect("/login"); } } works perfect logging in admin area, , checking if user logged in, when submit form '/admin/new' post route, browser hangs. nothing happens in console, console.log in place : exports.create = function(req, res){ console.log(req); // database logic here res.redirect('/admin'); } i cant seem work. hangs, , fails. browser console says 'pending' in network request. ive tried remov...
Comments
Post a Comment