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);
|
||||
}
|
||||
12
server/main.js
Normal file
12
server/main.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import '../imports/api/';
|
||||
import './google-oauth.js';
|
||||
import connectRoute from 'connect-route';
|
||||
|
||||
// Got the below code from:
|
||||
// https://docs.meteor.com/packages/webapp.html
|
||||
WebApp.connectHandlers.use(connectRoute((router) => {
|
||||
router.get('/ping', (req, res, next) => {
|
||||
//TODO: Change ping / pong to something appropriate for a browser plugin reporting user/machine data and requesting updates.
|
||||
res.end("pong");
|
||||
});
|
||||
}));
|
||||
Reference in New Issue
Block a user