-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
39 lines (31 loc) · 1.16 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// module.exports = function (app, passport) {
// // route for home page
// app.get('/', function (req, res) {
// res.render('index.ejs'); // load the index.ejs file
// });
// // route for showing the profile page
// app.get('/profile', isLoggedIn, function (req, res) {
// res.render('profile.ejs', {
// user: req.user // get the user out of session and pass to template
// });
// });
// // route for logging out
// app.get('/logout', function (req, res) {
// req.logout();
// res.redirect('/');
// });
// app.get('/auth/google', passport.authenticate('google', { scope: ['profile', 'email'] }));
// app.get('/auth/google/callback',
// passport.authenticate('google', {
// successRedirect: '/profile',
// failureRedirect: '/'
// }));
// };
// // route middleware to make sure a user is logged in
// function isLoggedIn(req, res, next) {
// // if user is authenticated in the session, carry on
// if (req.isAuthenticated())
// return next();
// // if they aren't redirect them to the home page
// res.redirect('/');
// }