Created
August 17, 2013 04:36
-
-
Save nightfly19/6255281 to your computer and use it in GitHub Desktop.
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
| 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