Passport-Google-OAuth Callback Not working

前端 未结 2 832
情深已故
情深已故 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:39

    i just found out that passport-google-oauth package exports the following:

    exports.Strategy =
    exports.OAuthStrategy = OAuthStrategy;
    exports.OAuth2Strategy = OAuth2Strategy;
    

    which means, that the "default" (ie. Strategy) is not oauth2 at all... So you better use OAuth2Strategy explicitly. it worked for me. Took me hours to find out this was the problem...

提交回复
热议问题