wip wiring up account forms

This commit is contained in:
cleverbeagle 2017-05-25 16:31:01 -05:00
parent cdc15f019d
commit 3459bf26f8
25 changed files with 413 additions and 53 deletions

View file

@ -0,0 +1,18 @@
import { Meteor } from 'meteor/meteor';
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
import { _ } from 'meteor/underscore';
const fetchMethodNames = methods => _.pluck(methods, 'name');
const assignLimits = ({ methods, limit, timeRange }) => {
const methodNames = fetchMethodNames(methods);
if (Meteor.isServer) {
DDPRateLimiter.addRule({
name(name) { return _.contains(methodNames, name); },
connectionId() { return true; },
}, limit, timeRange);
}
};
export default function rateLimit(options) { return assignLimits(options); }