Skip to content

Commit 8eb66c0

Browse files
committed
Disable log of auth blocks by default
1 parent 2824da2 commit 8eb66c0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Middleware/BlockBots.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public function handle($request, Closure $next, $limit = 100, $frequency = 'dail
4949
protected function notAllowed()
5050
{
5151
if ($this->options->log) {
52-
$this->logDisallowance();
52+
if (!$this->options->log_only_guest || Auth::guest()) {
53+
$this->logDisallowance();
54+
}
5355
}
5456

5557
if (Auth::check() && $this->isTheFirstOverflow()) {

src/config/block-bots.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
*/
5555

5656
'log' => env('BLOCK_BOTS_LOG_ENABLED', env('BLOCK_BOTS_LOG_BLOCKED_REQUESTS', true)),
57+
'log_only_guest' => env('BLOCK_BOTS_LOG_ONLY_GUEST', true),
5758

5859
/*
5960
* The list of allowed user-agents. The value of the key should be a keyword in hostname or * for enable to everyone

0 commit comments

Comments
 (0)