-
-
Notifications
You must be signed in to change notification settings - Fork 356
[UX Turbo Mercure] EventSource is missing withCredentials #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From the docs - https://symfony.com/doc/current/mercure.html#authorization - I think you're correct, unless you're using anonymous (as you mentioned). I'm not sure if there is a downside to always setting this or not - @dunglas? |
We'd better make it opt-in I guess bigskysoftware/intercooler-js#292 (comment):
Also, it's not supported by IE yet. |
It's only necessary if you use authorization and if your Mercure hub doesn't share the same domain as your app. To me it should be an option but not enabled by default. |
In my case this is not working. The mercure hub is on the same domain (Port 3000) but the authorization cookie is not sent unless I add withCredentials: true to the EventSource. |
@Komet |
Maybe I was actually mistaken, by reading the UX turbo documentation I thought that a call to the |
@robinbrisa please keep this issue focused on the actual bug/feature. See https://symfony.com/support for some common channels to get community support (e.g. GitHub discussions or Slack). |
I/we are affected by the same issue presented here, following the documentation at: https://github.com/symfony/ux/blame/2.x/src/Turbo/doc/index.rst#L541 It's clear that it cannot be used in a private/production environment i.e. when using authentication on subscriptions. In my opinion @robinbrisa raises a valid issue that the published documentation (also part of this repository) doesn't have a clear callout on the limitation, where Advising to directing to 'support channels' are not useful as it directly related to the cross-domain cookie authentication use-case not covered in the code: ux/src/Turbo/Bridge/Mercure/Resources/assets/src/turbo_stream_controller.ts
This is not entirely correct, I'm running mercure on a sub-domain (mecure.x.x) and the app is running on app.x.x) and I'm affected in latest chromium. I feel this is a common (if not primary) use-case, and I'd argue it's not 'secured by default' (aka authenticated/private) and should be called out prominently in: https://github.com/symfony/ux/blob/0288ebd2abd1241297450e7443d49c488f0e4598/src/Turbo/doc/index.rst Incidentally I've forked the repo, added the |
Hi, isn't
{withCredentials: true}
missing inux/src/Turbo/Bridge/Mercure/Resources/assets/src/turbo_stream_controller.ts
Line 36 in 09fca7d
WIthout it the mercureAuthorization cookie will not be sent to mercure hub and it returns HTTP 401 (unless configured anonymous).
The text was updated successfully, but these errors were encountered: