1var GoogleStrategy = require( 'passport-google-oauth2' ).Strategy;
2
3passport.use(new GoogleStrategy({
4 clientID: GOOGLE_CLIENT_ID,
5 clientSecret: GOOGLE_CLIENT_SECRET,
6 callbackURL: "http://yourdomain:3000/auth/google/callback",
7 passReqToCallback : true
8 },
9 function(request, accessToken, refreshToken, profile, done) {
10 User.findOrCreate({ googleId: profile.id }, function (err, user) {
11 return done(err, user);
12 });
13 }
14));
15