@@ -55,12 +55,6 @@ class AikidoMiddleware implements MiddlewareInterface
5555 if ($decision->trigger == "user") {
5656 $message = "Your user is blocked!";
5757 }
58- else if ($decision->trigger == "ip") {
59- $message = "Your IP ({$decision->ip}) is blocked due to: {$decision->description}!";
60- }
61- else if ($decision->trigger == "user-agent") {
62- $message = "Your user agent ({$decision->user_agent}) is blocked due to: {$decision->description}!";
63- }
6458
6559 return new Response([
6660 'message' => $message,
@@ -118,14 +112,14 @@ class ZenBlockDecision
118112 return $next($request);
119113 }
120114
121- // Get the authenticated user's ID from Laravel's Auth system
122- $userId = Auth::id();
115+ // Get the authenticated user's ID from Laravel's Auth system
116+ $userId = Auth::id();
123117
124- // If a user is authenticated, set the user in Aikido's firewall context
125- if ($userId) {
126- // If username is available, you can set it as the second parameter in the \aikido\set_user function call
127- \aikido\set_user($userId);
128- }
118+ // If a user is authenticated, set the user in Aikido's firewall context
119+ if ($userId) {
120+ // If username is available, you can set it as the second parameter in the \aikido\set_user function call
121+ \aikido\set_user($userId);
122+ }
129123
130124 // Check blocking decision from Aikido
131125 $decision = \aikido\should_block_request();
@@ -135,9 +129,6 @@ class ZenBlockDecision
135129 if ($decision->trigger == "user") {
136130 return response('Your user is blocked!', 403);
137131 }
138- else if ($decision->trigger == "ip") {
139- return response("Your IP ({$decision->ip}) is blocked due to: {$decision->description}!", 403);
140- }
141132 }
142133 else if ($decision->type == "ratelimited") {
143134 if ($decision->trigger == "user") {
0 commit comments