-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassport.js
41 lines (35 loc) · 1.33 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
40
41
'use strict';
var passport = require('passport');
// var TwitterTokenStrategy = require('passport-twitter-token');
var FacebookTokenStrategy = require('passport-facebook-token');
// var GoogleTokenStrategy = require('passport-google-token').Strategy;
const config = require('./config/serverConfig.json');
module.exports = function() {
passport.use(new FacebookTokenStrategy({
clientID: config.facebookAuth.clientID,
clientSecret: config.facebookAuth.clientSecret
},
function(accessToken, refreshToken, profile, done) {
const user = {accessToken, profile};
return done(null, user);
}));
// passport.use(new TwitterTokenStrategy({
// consumerKey: config.twitterAuth.consumerKey,
// consumerSecret: config.twitterAuth.consumerSecret,
// includeEmail: true
// },
// function(token, tokenSecret, profile, done) {
// User.upsertTwitterUser(token, tokenSecret, profile, function(err, user) {
// return done(err, user);
// });
// }));
// passport.use(new GoogleTokenStrategy({
// clientID: config.googleAuth.clientID,
// clientSecret: config.googleAuth.clientSecret
// },
// function(accessToken, refreshToken, profile, done) {
// User.upsertGoogleUser(accessToken, refreshToken, profile, function(err, user) {
// return done(err, user);
// });
// }));
};