icynetify

This commit is contained in:
Evert Prants 2017-09-06 22:21:59 +03:00
parent 5e502244cc
commit a632baf6cb
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
1 changed files with 12 additions and 10 deletions

View File

@ -49,8 +49,9 @@
*/
var constants = Object.freeze({
type: '', // Either 'oauth' or 'oauth2'
name: '', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb"
type: 'oauth2', // Either 'oauth' or 'oauth2'
name: 'icynet', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb"
scope: 'email privilege',
oauth: {
requestTokenURL: '',
accessTokenURL: '',
@ -59,12 +60,12 @@
consumerSecret: nconf.get('oauth:secret'), // don't change this line
},
oauth2: {
authorizationURL: '',
tokenURL: '',
clientID: nconf.get('oauth:id'), // don't change this line
clientSecret: nconf.get('oauth:secret'), // don't change this line
authorizationURL: nconf.get('oauth:provider') + '/oauth2/authorize',
tokenURL: nconf.get('oauth:provider') + '/oauth2/token',
clientID: nconf.get('oauth:id'),
clientSecret: nconf.get('oauth:secret'),
},
userRoute: '' // This is the address to your app's "user profile" API endpoint (expects JSON)
userRoute: nconf.get('oauth:provider') + '/oauth2/user'
}),
configOk = false,
OAuth = {}, passportOAuth, opts;
@ -171,15 +172,16 @@
var profile = {};
profile.id = data.id;
profile.displayName = data.name;
profile.displayName = data.display_name;
profile.emails = [{ value: data.email }];
profile.isAdmin = data.privilege === 5;
// Do you want to automatically make somebody an admin? This line might help you do that...
// profile.isAdmin = data.isAdmin ? true : false;
// Delete or comment out the next TWO (2) lines when you are ready to proceed
process.stdout.write('===\nAt this point, you\'ll need to customise the above section to id, displayName, and emails into the "profile" object.\n===');
return callback(new Error('Congrats! So far so good -- please see server log for details'));
//process.stdout.write('===\nAt this point, you\'ll need to customise the above section to id, displayName, and emails into the "profile" object.\n===');
//return callback(new Error('Congrats! So far so good -- please see server log for details'));
callback(null, profile);
}