From 2747b59abc7f5697786b7b25099f5b08b32b4e76 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Mon, 11 Mar 2024 02:19:20 +0100 Subject: [PATCH] Cleaned up duplicate code --- src/Broker/Topic.php | 2 +- src/Http/Middleware/MercureHandler.php | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Broker/Topic.php b/src/Broker/Topic.php index 23e3dc8..20564da 100644 --- a/src/Broker/Topic.php +++ b/src/Broker/Topic.php @@ -28,7 +28,7 @@ class Topic public function publish(Message $message) { - // TODO check if message id has already been published + // check if message id has already been published if (isset($this->messages[$message->id])) return; $this->messages[$message->id] = $message; diff --git a/src/Http/Middleware/MercureHandler.php b/src/Http/Middleware/MercureHandler.php index 2f883ae..0e8d9ce 100644 --- a/src/Http/Middleware/MercureHandler.php +++ b/src/Http/Middleware/MercureHandler.php @@ -64,14 +64,6 @@ class MercureHandler */ private function handleMercureClient(ServerRequestInterface $request): ResponseInterface { - $tok = $request->getAttribute('authorization'); - if ($tok instanceof JWTToken) { - $claims = $tok->claims->getAll(); - if (isset($claims['mercure']['subscribe'])) { - $subscribeClaims = $claims['mercure']['subscribe']; - // TODO check topic against subscribeClaims - } - } $responseStream = new ThroughStream();