Skip to content

Commit ae5a281

Browse files
committed
Step 17.3: Configure oauth services using service-configuration
1 parent 3fa5a6e commit ae5a281

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

api/server/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@ import { Meteor } from 'meteor/meteor';
22
import { Picture } from './models';
33
import { Accounts } from 'meteor/accounts-base';
44
import { Users } from './collections/users';
5+
declare const ServiceConfiguration: any;
56

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

13+
// Configuring oAuth services
14+
const services = Meteor.settings.private.oAuth;
15+
16+
if (services) {
17+
for (let service in services) {
18+
ServiceConfiguration.configurations.upsert({service: service}, {
19+
$set: services[service]
20+
});
21+
}
22+
}
23+
1224
if (Users.collection.find().count() > 0) {
1325
return;
1426
}

0 commit comments

Comments
 (0)