Sup_File/auth/google.js

17 lines
624 B
JavaScript
Raw Normal View History

2018-05-17 20:22:09 +00:00
var passport = require('passport');
var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;
passport.use(new GoogleStrategy({
clientID: "633754977454-7dcfrsfob7sjq5lim47tc63pdjch6imr.apps.googleusercontent.com",
clientSecret: "D7lHcUgZbCpmWZtooRlICzAH",
2018-05-21 12:08:44 +00:00
callbackURL: "https://localhost:3000/api/google/callback"
2018-05-17 20:22:09 +00:00
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({ userid: profile.id }, { name: profile.displayName,userid: profile.id }, function (err, user) {
return done(err, user);
});
}
));
2018-05-21 12:08:44 +00:00
module.exports = passport;