I'm learning passportjs. I'm looking at the passport-google example here https://github.com/jaredhanson/passport-google/blob/master/examples/signon/app.js
It contains the following lines of code
app.get('/auth/google',
passport.authenticate('google', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
And subsequently, these lines:
app.get('/auth/google/return',
passport.authenticate('google', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
Can someone help me understand why the duplicate call to passport.authenticate is needed?