-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
57 lines (55 loc) · 1.1 KB
/
config.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
var R = require('ramda')
const baseConfig = {
server: {
protocol: 'http',
transport: 'session',
state: true,
callback: '/oauth/callback',
path: '/oauth'
},
twitter: {
title: 'Twitter',
purest: {
get: 'account/verify_credentials',
authInConstructor: true,
data: (body) => ({
name: body.name,
url: `https://twitter.com/${body.screen_name}`
})
}
},
facebook: {
title: 'Facebook',
scope: ['email'],
purest: {
get: 'me',
data: (body) => ({
name: body.name,
url: `https://www.facebook.com/${body.id}`
})
}
},
google: {
title: 'Google',
scope: ['profile'],
purest: {
query: 'plus',
get: 'people/me',
data: (body) => ({
name: body.displayName
})
}
},
github: {
title: 'GitHub',
purest: {
get: 'user',
data: (body) => ({
name: body.name,
url: body.html_url
})
}
}
}
module.exports = (config) => R.fromPairs(Object.keys(config)
.map((key) => [key, Object.assign(config[key], baseConfig[key])]))