Passport authenticate callback is not passed req and res

前端 未结 2 1626
太阳男子
太阳男子 2021-01-02 01:26

this authenticate works fine and I get a redirect:

server.post(authPostRoute, passport.authenticate(
    \'local\'
    , { successRedirect: \'/\', failureRed         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 02:12

    Enable passReqToCallback to get the request in callback. Like this:

    passport.use(new FacebookStrategy({
        clientID: '555555555555555',
        clientSecret: '555555555555555555555',
        callbackURL: "http://localhost:3000/auth/facebook/callback",
        enableProof: false,
        passReqToCallback: true
      },
      // The request will be provided as 1st param
      function(req, accessToken, refreshToken, profile, done) {
      });...
    

提交回复
热议问题