Cleaned up duplicate code
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user