You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rate limiting is applied to authentication and registration endpoints to prevent abuse. The following parameters can be configured to change its behavior. Additional configuration options are provided by the <ExternalLinktext="koa2-ratelimit"to="https://github.com/ysocorp/koa2-ratelimit?tab=readme-ov-file#configuration"/> package:
352
+
353
+
354
+
The following options are available in [the `/config/plugins` file](/cms/configurations/plugins):
355
+
356
+
| Parameter | Description | Type | Default |
357
+
| --------- | ----------- | ---- | ------- |
358
+
|`ratelimit`| Settings to customize the rate limiting of the authentications and registration endpoints | object |`{}`|
359
+
|`ratelimit.enabled`| Enable or disable the rate limiter | boolean |`true`|
360
+
|`ratelimit.interval`| Time window for requests to be considered as part of the same rate limiting bucket | object |`{ min: 5 }`|
361
+
|`ratelimit.max`| Maximum number of requests allowed in the time window | integer |`5`|
362
+
|`ratelimit.prefixKey`| Prefix for the rate limiting key | string |`${userIdentifier}:${requestPath}:${ctx.request.ip}`|
363
+
364
+
365
+
<TabsgroupId="js-ts">
366
+
367
+
<TabItemvalue="javascript"label="JavaScript">
368
+
369
+
```js title="/config/plugins.js"
370
+
module.exports= ({ env }) => ({
371
+
// ... other plugins configuration ...
372
+
// Users & Permissions configuration
373
+
'users-permissions': {
374
+
config: {
375
+
ratelimit: {
376
+
enabled:true,
377
+
interval: { min:5 },
378
+
max:5,
379
+
},
380
+
},
381
+
},
382
+
// ...
383
+
});
384
+
```
385
+
386
+
</TabItem>
387
+
388
+
<TabItemvalue="typescript"label="TypeScript">
389
+
390
+
```ts title="/config/plugins.ts"
391
+
exportdefault ({ env }) => ({
392
+
// ... other plugins configuration ...
393
+
// Users & Permissions configuration
394
+
'users-permissions': {
395
+
config: {
396
+
ratelimit: {
397
+
enabled: true,
398
+
interval: { min: 5 },
399
+
max: 5,
400
+
},
401
+
},
402
+
},
403
+
// ...
404
+
});
405
+
```
406
+
407
+
</TabItem>
408
+
409
+
</Tabs>
410
+
349
411
### Templating emails
350
412
351
413
By default this plugin comes with two templates: reset password and email address confirmation. The templates use <ExternalLinkto="https://lodash.com/docs/4.17.15#template"text="Lodash's `template()` method"/> to populate the variables.
0 commit comments