Passport-Google-OAuth Callback Not working

前端 未结 2 816
情深已故
情深已故 2021-02-19 22:55

I have the following Node code using passport-google-oauth...

app.get(\'/auth/google\', passport.authenticate(\'google\', { scope : [\'profile\', \'email\'] }));         


        
2条回答
  •  抹茶落季
    2021-02-19 23:33

    You didn't use "passport.authenticate('google')" middleware inside the second route '/auth/google/callback'.

    your second route should be like :

    app.get( '/auth/google/callback', 
        	passport.authenticate( 'google', { 
        		successRedirect: '/',
        		failureRedirect: '/login'
    }));

提交回复
热议问题