-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.js
More file actions
23 lines (19 loc) · 720 Bytes
/
Copy pathauth.js
File metadata and controls
23 lines (19 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth2').Strategy;
const GOOGLE_CLIENT_ID = '479963282741-lctkne9a1tpeb1mq3h2atba208pr88io.apps.googleusercontent.com';
const GOOGLE_CLIENT_SECRET = '95hN6rBJlD2okXh7ccfSDNUi';
passport.use(new GoogleStrategy({
clientID: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/google/callback",
passReqToCallback: true,
},
function(request, accessToken, refreshToken, profile, done) {
return done(null, profile);
}));
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(user, done) {
done(null, user);
});