I’m trying to put a DDP rate limiter on the number of login attempts coming in from the client to the server. I’ve gone through the official documentation but I’m unable to verify if any of it even works.
I’ve added the package: ddp-rate-limiter
My server code is:
Meteor.startup(function() {
var preventBruteForeLogin= {
type: 'method',
name: 'Meteor.loginWithPassword'
}
DDPRateLimiter.addRule(preventBruteForeLogin, 1, 2000);
DDPRateLimiter.setErrorMessage("slow down");
});
My understanding with the above is that it has added a rate limiting rule on Meteor.loginWithPassword method that it only allows one attempt every 2 seconds. However, given the little information available in the documentation and elsewhere on the net, I’m unable to figure out if it’s actually working or if I’ve done it wrong. I’ve also gone through MC’s blog on this and frankly I don’t understand the coffee script code. Can someone guide me through this?
PS - Posted it on SO, in case someone wants to help.
Thanks.