jaredhanson / passport-google-oauth

Google authentication strategies for Passport and Node.js.
https://www.passportjs.org/packages/passport-google-oauth/?utm_source=github&utm_medium=referral&utm_campaign=passport-google-oauth&utm_content=about
MIT License
776 stars 327 forks source link

OAuth2Strategy requires a verify callback how to fix it? #126

Closed annibuliful closed 7 years ago

annibuliful commented 7 years ago

888

amp89 commented 7 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

annibuliful commented 7 years ago

I fixed it by enabling Google+ API because It is important for authentication

roganoalien commented 5 years ago

@amp89 you basically saved me, was driving me crazy too!!!

codewithmero commented 5 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

Oh thank you sir. You are a saver

malithkuruwita commented 5 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

you are a savior

shweta1907 commented 4 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

you saved me from wasting 1hr,thank you

namsehoon commented 4 years ago

You are my savior

adeanam commented 4 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

Lord and saviour

sajjadmrx commented 3 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

You are my savior :))))

shivavishnoi commented 2 years ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

Thank You Very Much!!

StevenMODIMO commented 1 year ago

Solution by amp89 worked

ranaadeel15911 commented 10 months ago

I had this same problem and it drove me insane for like an hour...

You are calling it like passport.use(new GoogleStrategy({}), function(){} ) but it should be: passport.use(new GoogleStrategy( {}, function(){} ) ) //Note where I moved the parenthesis

GoogleStrategy takes 2 arguments, the first is the object with the id/secret/url, and the 2nd is the function, and new GoogleStrategy is the only thing you pass into passportjs.use().

Amazing sir