Improved jwt logic
* No longer stores full token, but only payload.
This commit is contained in:
@ -26,7 +26,12 @@ class SseSubscriber implements SubscriberInterface
|
||||
|
||||
public function isAuthorized(): bool
|
||||
{
|
||||
return $this->request->getAttribute('authorization') instanceof JWTToken;
|
||||
return $this->request->getAttribute('authorized');
|
||||
}
|
||||
|
||||
public function getPayload(): array
|
||||
{
|
||||
return $this->request->getAttribute('mercure.payload')??[];
|
||||
}
|
||||
|
||||
public function getId(): string
|
||||
|
@ -69,7 +69,7 @@ class TopicManager
|
||||
'topic' => $topic->getTopic(),
|
||||
'subscriber' => $sub->getId(),
|
||||
'active' => true,
|
||||
'payload' => null, // TODO populate from mercure.payload in JWT
|
||||
'payload' => $sub->getPayload(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user