-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.js
More file actions
27 lines (23 loc) · 781 Bytes
/
auth.js
File metadata and controls
27 lines (23 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;
const cbu = "http://smartnote.live/auth/google/callback"
const client_secret = "OtwU_IQcyJInAVQjtOTx6Ruk"
const client_id = "758782554681-f2unkbc8tduhuo8k0jmspvnp863jafi2.apps.googleusercontent.com"
module.exports = (passport) => {
passport.serializeUser((user, done) => {
done(null, user);
});
passport.deserializeUser((user, done) => {
done(null, user);
});
passport.use(new GoogleStrategy({
clientID: client_id,
clientSecret: client_secret,
callbackURL: cbu
},
(token, refreshToken, profile, done) => {
return done(null, {
profile: profile,
token: token
});
}));
};