-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassport.js
40 lines (32 loc) · 1.21 KB
/
passport.js
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
28
29
30
31
32
33
34
35
36
37
38
39
// const passport = require('passport');
// const GoogleStrategy = require('passport-google-oauth').OAuthStrategy;
// require('dotenv').config();
// passport.serializeUser(function(user, done) {
// done(null, user);
// });
// passport.deserializeUser(function(user, done) {
// done(null, user);
// });
// // passport.deserializeUser(function(id, done) {
// // User.findById(id, function(null, user) {
// // done(null, user);
// // });
// // });
// // Use the GoogleStrategy within Passport.
// // Strategies in passport require a `verify` function, which accept
// // credentials (in this case, a token, tokenSecret, and Google profile), and
// // invoke a callback with a user object.
// passport.use(new GoogleStrategy({
// consumerKey: process.env.consumerKey,
// consumerSecret: process.env.consumerSecret,
// callbackURL: "http://localhost:3000/google/callback"
// },
// function(token, tokenSecret, profile, done) {
// return done(null, user);
// }
// // function(token, tokenSecret, profile, done) {
// // User.findOrCreate({ googleId: profile.id }, function (null, user) {
// // return done(null, user);
// // });
// // }
// ));