diff --git a/app/Http/Middleware/GitHubMiddleware.php b/app/Http/Middleware/GitHubMiddleware.php index a21ae57..d4a8c11 100644 --- a/app/Http/Middleware/GitHubMiddleware.php +++ b/app/Http/Middleware/GitHubMiddleware.php @@ -19,8 +19,10 @@ class GitHubMiddleware public function handle(Request $request, Closure $next) { - $this->throw(fn () => $this->signature($request)); - $this->throw(fn () => $this->hashed($request)); + if ($this->isProduction()) { + $this->throw(fn () => $this->signature($request)); + $this->throw(fn () => $this->hashed($request)); + } if ($this->hasCreatedHook($request)) { $this->connect($request); @@ -76,4 +78,9 @@ protected function connect(Request $request): void ConnectRepositoryJob::dispatch($organization, $repository); } + + protected function isProduction(): bool + { + return app()->isProduction(); + } }