Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4511bb5

Browse files
committedJan 8, 2025·
rate limit by default none
1 parent 0d519df commit 4511bb5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
 

‎README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ MAGICLINK_DELETE_MASSIVE=false
347347
## Customization
348348

349349
### Config
350+
350351
To custom this package you can publish the config file:
351352

352353
```bash
@@ -440,12 +441,13 @@ return a `view()`
440441
You can limit the number of requests per minute for a magic link. To do this, you need to
441442
set the `MAGICLINK_RATE_LIMIT` environment variable to the desired value.
442443

443-
By default, the rate limit is 100 attempts per minutes. Use `none` to disable the rate limit.
444+
By default, the rate limit is disable with value 'none', but you can set a value
445+
to limit the requests. For example, to limit the requests to 100 per minute, set
444446

445447
```bash
446448
# .env
447449

448-
MAGICLINK_RATE_LIMIT='none'
450+
MAGICLINK_RATE_LIMIT=100
449451
```
450452

451453
## Testing

‎config/magiclink.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
|
6969
| Here you may specify the number of attempts to rate limit per minutes
7070
|
71-
| Default: 100, if you want to disable rate limit, set as 'none'
71+
| Default: none, if you want to enable rate limit, set as integer
7272
*/
73-
'rate_limit' => env('MAGICLINK_RATE_LIMIT', 100),
73+
'rate_limit' => env('MAGICLINK_RATE_LIMIT', 'none'),
7474

7575
'token' => [
7676
/*

‎src/MagicLinkServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function boot()
2626

2727
private function registerRateLimit(): void
2828
{
29-
$rateLimit = config('magiclink.rate_limit', 100);
29+
$rateLimit = config('magiclink.rate_limit', 'none');
3030

3131
RateLimiter::for(
3232
'magiclink',

0 commit comments

Comments
 (0)