Initial check in; All but the history pages working.
This commit is contained in:
54
server/google-oauth.js
Normal file
54
server/google-oauth.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
console.log("Setting up Google OAuth...");
|
||||
|
||||
try {
|
||||
let settings = Assets.getText('settings.json');
|
||||
|
||||
if(settings) {
|
||||
try {
|
||||
settings = JSON.parse(settings);
|
||||
}
|
||||
catch(err) {
|
||||
console.error("Failed to load the /private/settings.json file as a JSON object.");
|
||||
console.error(err);
|
||||
settings = null;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
ServiceConfiguration.configurations.upsert(
|
||||
{ service: 'google' },
|
||||
{
|
||||
$set: {
|
||||
clientId: '651343079360-hm5vvji109lphnavft8vej5pp1ruek5q.apps.googleusercontent.com',
|
||||
loginStyle: 'popup',
|
||||
secret: 'VAQFr6UBkZ0ZMQJ7tb471BmW'
|
||||
}
|
||||
}
|
||||
);
|
||||
*/
|
||||
|
||||
console.log("Finished OAuth setup.")
|
||||
Reference in New Issue
Block a user