Created
February 29, 2012 14:48
-
-
Save BenHall/1941301 to your computer and use it in GitHub Desktop.
passport.js auth route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.ensureAuthenicated = function(req, res, next) { | |
if (req.isAuthenticated()) { return next(); } | |
res.redirect('/login') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passport = require('./auth/passport'); | |
app.get('/', passport.ensureAuthenicated, function(req, res){ | |
res.redirect('/acquisition'); | |
}); |
Just a small typo:
ensureAuthenicated
which should be
ensureAuthenticated
Had me thrown off for a bit :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks ! worked like a champ.