Added password validator and facebook routes

This commit is contained in:
Sahat Yalkabov
2013-11-19 01:34:09 -05:00
parent 09c2c99634
commit 07ac42ae8d
4 changed files with 19 additions and 1 deletions

13
app.js
View File

@@ -52,6 +52,19 @@ app.get('/account', passportConf.ensureAuthenticated, user.account);
app.get('/admin', passportConf.ensureAuthenticated, passportConf.ensureAdmin(), user.admin);
app.get('/partials/:name', home.partials);
// Redirect the user to Facebook for authentication. When complete,
// Facebook will redirect the user back to the application at
app.get('/auth/facebook', passport.authenticate('facebook'));
// Facebook will redirect the user to this URL after approval. Finish the
// authentication process by attempting to obtain an access token. If
// access was granted, the user will be logged in. Otherwise,
// authentication has failed.
app.get('/auth/facebook/callback', passport.authenticate('facebook', {
successRedirect: '/',
failureRedirect: '/login'
}));
app.get('*', home.index);