Added password validator and facebook routes
This commit is contained in:
13
app.js
13
app.js
@@ -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);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user