Cleaned up duplicate code

This commit is contained in:
Chris 2024-03-11 02:19:20 +01:00
parent 0714db3f29
commit 2747b59abc
2 changed files with 1 additions and 9 deletions

View File

@ -28,7 +28,7 @@ class Topic
public function publish(Message $message) 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; if (isset($this->messages[$message->id])) return;
$this->messages[$message->id] = $message; $this->messages[$message->id] = $message;

View File

@ -64,14 +64,6 @@ class MercureHandler
*/ */
private function handleMercureClient(ServerRequestInterface $request): ResponseInterface 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(); $responseStream = new ThroughStream();