-
Notifications
You must be signed in to change notification settings - Fork 71
/
config.js
38 lines (31 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
const providers = ['twitter', 'google', 'facebook', 'github']
const callbacks = providers.map(provider => {
return process.env.NODE_ENV === 'production'
? `https://react-auth-twitter.herokuapp.com/${provider}/callback`
: `https://localhost:8080/${provider}/callback`
})
const [twitterURL, googleURL, facebookURL, githubURL] = callbacks
exports.CLIENT_ORIGIN = process.env.NODE_ENV === 'production'
? 'https://react-auth-twitter.netlify.com'
: ['https://127.0.0.1:3000', 'https://localhost:3000']
exports.TWITTER_CONFIG = {
consumerKey: process.env.TWITTER_KEY,
consumerSecret: process.env.TWITTER_SECRET,
callbackURL: twitterURL,
}
exports.GOOGLE_CONFIG = {
clientID: process.env.GOOGLE_KEY,
clientSecret: process.env.GOOGLE_SECRET,
callbackURL: googleURL
}
exports.FACEBOOK_CONFIG = {
clientID: process.env.FACEBOOK_KEY,
clientSecret: process.env.FACEBOOK_SECRET,
profileFields: ['id', 'emails', 'name', 'picture.width(250)'],
callbackURL: facebookURL
}
exports.GITHUB_CONFIG = {
clientID: process.env.GITHUB_KEY,
clientSecret: process.env.GITHUB_SECRET,
callbackURL: githubURL
}