passport.js - Why is passport.authenticate called twice? -



passport.js - Why is passport.authenticate called twice? -

i'm learning passportjs. i'm looking @ passport-google illustration here https://github.com/jaredhanson/passport-google/blob/master/examples/signon/app.js

it contains next 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 help me understand why duplicate phone call passport.authenticate needed?

passport.js

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -