https://github.com/zeroasterisk/meteor-throttle-accounts
An extra layer to simplify throttling of Meteor Accounts
https://github.com/zeroasterisk/meteor-throttle-accounts
Last synced: about 1 year ago
JSON representation
An extra layer to simplify throttling of Meteor Accounts
- Host: GitHub
- URL: https://github.com/zeroasterisk/meteor-throttle-accounts
- Owner: zeroasterisk
- License: mit
- Created: 2015-03-28T04:11:37.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-05T03:38:01.000Z (about 10 years ago)
- Last Synced: 2023-03-11T05:08:12.049Z (over 3 years ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# An Extension of zeroasterisk:throttle for Meteor Accounts
* http://throttle-example.meteor.com
* [https://github.com/zeroasterisk/Meteor-Throttle-Example](https://github.com/zeroasterisk/Meteor-Throttle-Example)
* main *throttle* package
* [https://github.com/zeroasterisk/Meteor-Throttle](https://github.com/zeroasterisk/Meteor-Throttle)
* [Atmosphere Package](https://atmospherejs.com/zeroasterisk/throttle)
* additiional *throttle* package
* [https://github.com/zeroasterisk/Meteor-Throttle-Accounts](https://github.com/zeroasterisk/Meteor-Throttle-Accounts)
* [Atmosphere Package](https://atmospherejs.com/zeroasterisk/throttle-accounts)
This Extension of that package will throttle login attempts and account
creation attempts for your site:
## Install
$ meteor add zeroasterisk:throttle
$ meteor add zeroasterisk:throttle-accounts
## Configuration
```
if (Meteor.isServer) {
// core Throttle config
Throttle.setDebugMode(false); // default = false
Throttle.setScope("global"); // default = global
// NOTE: if you switch to "user" here, no other Accounts specific scopes are functional
// Accounts.validateLoginAttempt()
ThrottleAccounts.login('global', 20, 1000, 'Under Heavy Load - too many login attempts');
ThrottleAccounts.login('ip', 3, 1000, 'Only 3 Login Attempts from the same IP every second');
ThrottleAccounts.login('connection', 8, 10000, 'Only 8 Login Attempts from the same DDP connection every 10 seconds');
// Accounts.validateNewUser()
ThrottleAccounts.create('global', 20, 1000, 'Under Heavy Load - too many accounts created');
}
```
## Example
This is integrated into the Meteor-Throttle example:
* http://throttle-example.meteor.com/
* https://github.com/zeroasterisk/Meteor-Throttle-Example
Project came from this forum post:
https://forums.meteor.com/t/how-to-use-zeroasterisks-throttle-with-softwareros-accountstemplates/2128