diff --git a/app/Http/Middleware/HeaderAuth.php b/app/Http/Middleware/HeaderAuth.php index 3f8d2d3..306e695 100644 --- a/app/Http/Middleware/HeaderAuth.php +++ b/app/Http/Middleware/HeaderAuth.php @@ -15,6 +15,10 @@ class HeaderAuth */ public function handle(Request $request, Closure $next): Response { + if (is_null($request->header('X-BOTAUTH'))) { + return response() + ->json(["status" => false, "message" => "Unauthorized."], 401); + } if (!hash_equals(config('bot.header_auth'), $request->header('X-BOTAUTH'))) { return response('Unauthorized', 401); }