Permalink
Browse files

Step 17.3: Configure oauth services using service-configuration

  • Loading branch information...
darkbasic committed Jun 9, 2017
1 parent 3fa5a6e commit ae5a2810d20b53ec1712ca942dc36cf6c1f58111
Showing with 12 additions and 0 deletions.
  1. +12 −0 api/server/main.ts
View
@@ -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;
}

0 comments on commit ae5a281

Please sign in to comment.