Skip to content

Commit

Permalink
Step 17.3: Configure oauth services using service-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Oct 16, 2017
1 parent 3fa5a6e commit ae5a281
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/server/main.ts
Expand Up @@ -2,13 +2,25 @@ import { Meteor } from 'meteor/meteor';
import { Picture } from './models';
import { Accounts } from 'meteor/accounts-base';
import { Users } from './collections/users';
declare const ServiceConfiguration: any;

Meteor.startup(() => {
if (Meteor.settings) {
Object.assign(Accounts._options, Meteor.settings['accounts-phone']);
SMS.twilio = Meteor.settings['twilio'];
}

// Configuring oAuth services
const services = Meteor.settings.private.oAuth;

if (services) {
for (let service in services) {
ServiceConfiguration.configurations.upsert({service: service}, {
$set: services[service]
});
}
}

if (Users.collection.find().count() > 0) {
return;
}
Expand Down

0 comments on commit ae5a281

Please sign in to comment.