-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
60 lines (58 loc) · 1.71 KB
/
server.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var derbyStarter = require('derby-starter');
var options = {
auth: {
passport: {
failureRedirect: '/',
registerCallback: function(req, res, user, done) {
var model = req.getModel();
var $user = model.at('auths.' + user.id);
model.fetch($user, function() {
$user.set('email', $user.get('local.email'), done);
})
}
},
strategies: {
facebook: {
strategy: require('passport-facebook').Strategy,
conf: {
clientID: '58362219983',
clientSecret: 'da0fb6cbcb6cac1a0aca9f78200935d2',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
}
},
github: {
strategy: require('passport-github').Strategy,
conf: {
clientID: 'eeb00e8fa12f5119e5e9',
clientSecret: '61631bdef37fce808334c83f1336320846647115'
}
},
google: {
strategy: require('passport-google-oauth').OAuth2Strategy,
conf: {
clientID: '1060568558513-164eli9jaaf8nbjgv4asv3gutn72usl6.apps.googleusercontent.com',
clientSecret: 'lqYJ1NF1AEeAA07MUGrIynXD',
callbackURL: 'http://localhost:3000/auth/google/callback',
scope: 'https://www.googleapis.com/auth/plus.login'
}
},
vkontakte: {
strategy: require('passport-vkontakte').Strategy,
conf: {
clientID: '4373291',
clientSecret: 'fOZiLyGhSH1DHWLFFfZo',
callbackURL: 'http://localhost:3000/auth/vkontakte/callback'
}
}
},
user: {
id: true,
email: true,
facebook: true,
github: true,
google: true,
vkontakte: true
}
}
}
derbyStarter.run(__dirname + '/auth', options);