corrections found while writing documentation
This commit is contained in:
parent
5485eb9260
commit
ab22ebc967
17 changed files with 127 additions and 42 deletions
|
|
@ -1,14 +1,30 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { ServiceConfiguration } from 'meteor/service-configuration';
|
||||
import rateLimit from '../../../modules/rate-limit';
|
||||
|
||||
Meteor.methods({
|
||||
'oauth.verifyConfiguration': function oauthVerifyConfiguration(services) {
|
||||
check(services, Array);
|
||||
const verifiedServices = [];
|
||||
services.forEach((service) => {
|
||||
if (ServiceConfiguration.configurations.findOne({ service })) verifiedServices.push(service);
|
||||
});
|
||||
return verifiedServices.sort();
|
||||
|
||||
try {
|
||||
const verifiedServices = [];
|
||||
services.forEach((service) => {
|
||||
if (ServiceConfiguration.configurations.findOne({ service })) {
|
||||
verifiedServices.push(service);
|
||||
}
|
||||
});
|
||||
return verifiedServices.sort();
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'oauth.verifyConfiguration',
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue