Files
DistrictCentral/server/google-oauth.js

27 lines
657 B
JavaScript
Raw Normal View History

/**
* Google cloud platform: https://console.developers.google.com/apis/dashboard
* Setup a OAuth consent screen, then setup OAuth credentials.
* Loads the information from the /private/settings.json file.
*/
try {
let settingsFile = process.env.SETTINGS;
let settings = JSON.parse(Assets.getText(settingsFile));
if (settings) {
ServiceConfiguration.configurations.upsert({
service: "google"
}, {
$set: {
loginStyle: settings.google.loginStyle,
clientId: settings.google.clientId,
secret: settings.google.secret
}
}
);
} else {
console.log("Error: No settings file.");
}
} catch (err) {
console.log(err);
}