Initial commit - cloned the Svelte todo's app with google login enabled as a starting point. This system will initially be used to let the chrome extension for students report which computers are used by which students and when.
This commit is contained in:
27
server/google-oauth.js
Normal file
27
server/google-oauth.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user