This commit is contained in:
Julian Lam 2017-07-06 11:19:25 -04:00
parent 03dc0d3ea4
commit 312321b79b

View File

@ -29,6 +29,25 @@
var authenticationController = module.parent.require('./controllers/authentication'); var authenticationController = module.parent.require('./controllers/authentication');
/**
* REMEMBER
* Never save your OAuth Key/Secret or OAuth2 ID/Secret pair in code! It could be published and leaked accidentally.
* Save it into your config.json file instead:
*
* {
* ...
* "oauth": {
* "id": "someoauthid",
* "secret": "youroauthsecret"
* }
* ...
* }
*
* ... or use environment variables instead:
*
* `OAUTH__ID=someoauthid OAUTH__SECRET=youroauthsecret node app.js`
*/
var constants = Object.freeze({ var constants = Object.freeze({
type: '', // Either 'oauth' or 'oauth2' type: '', // Either 'oauth' or 'oauth2'
name: '', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb" name: '', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb"
@ -36,14 +55,14 @@
requestTokenURL: '', requestTokenURL: '',
accessTokenURL: '', accessTokenURL: '',
userAuthorizationURL: '', userAuthorizationURL: '',
consumerKey: '', consumerKey: nconf.get('oauth:key'), // don't change this line
consumerSecret: '' consumerSecret: nconf.get('oauth:secret'), // don't change this line
}, },
oauth2: { oauth2: {
authorizationURL: '', authorizationURL: '',
tokenURL: '', tokenURL: '',
clientID: '', clientID: nconf.get('oauth:id'), // don't change this line
clientSecret: '' clientSecret: nconf.get('oauth:secret'), // don't change this line
}, },
userRoute: '' // This is the address to your app's "user profile" API endpoint (expects JSON) userRoute: '' // This is the address to your app's "user profile" API endpoint (expects JSON)
}), }),