Skip to content

Instantly share code, notes, and snippets.

@nightfly19
Created August 17, 2013 04:36
Show Gist options
  • Select an option

  • Save nightfly19/6255281 to your computer and use it in GitHub Desktop.

Select an option

Save nightfly19/6255281 to your computer and use it in GitHub Desktop.
app.get(
'/secure',
//What middleware to use here to see if I've already authenticated?
passport.authorize('ldap', { failureFlash: true }),
function(req, res){
res.render('index', {
pageTitle:'something here',
body:'cows mooooo'
});
}
);
app.get(
'/login',
function(req, res){
res.render('login', {
pageTitle: 'Login here',
body: 'Kittens',
});
}
);
app.post(
'/login',
passport.authenticate('ldap', {
successRedirect: '/secure',
failureRedirect: '/login'
})
);
app.get('/index.htm', function(req, res){
var body = "Mew mew mew";
res.send(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment