symfony / mercure

The Mercure Component allows to easily push updates to web browsers and other HTTP clients using the Mercure protocol.
https://symfony.com/doc/current/components/mercure.html
MIT License
413 stars 39 forks source link

Feature request: Twig helper generating hub URL with authorization parameter #100

Open wooky opened 1 year ago

wooky commented 1 year ago

If the Mercure hub is located on a completely different domain from the one where the front-end is hosted, then authorizing with the hub using cookies doesn't work (AFAIK). Using Authorization header doesn't work with the browser's native EventSource. This leaves adding an authorization parameter to the hub query.

I propose adding a Twig extension to generate a hub URL, similar to the existing mercure() function, but adding an authorization param to the query.