pusher-channels-flutter icon indicating copy to clipboard operation
pusher-channels-flutter copied to clipboard

'broadcasting/auth' - XMLHttpRequest issue for flutter for web app - how fix?

Open FetFrumos opened this issue 2 years ago • 1 comments

I wrote my own chat using pusher-channels-flutter. It was quite difficult - now it works - but there is a problem. The architecture is as follows:

  • mobile application flutter
  • web app -flutter for web
  • between them the Laravel server part

it all works when i run web app with the "--disable-web-security" flag. Otherwise, I get a 403 error when request "broadcasting/auth" - I see the following message in the console. :53050/#/login:1 Access to XMLHttpRequest at 'https://site.com/broadcasting/auth' from origin 'http://localhost:53050' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

I set up CORS on the server - very loyal rules if I use postman - the query works without problems. How can this be fixed? Any advice I'd appreciate - this problem has taken a long time.

FetFrumos avatar Feb 08 '24 20:02 FetFrumos

Hi dear,

I dont have the solution to the issue raised (I'm sorry), but I have a question. I would love to know if your chat worked well for mobile? This is in reference to the issue I raised #144 that is yet to be resolved. If yes, could you pls share a snippet of your code. I am also using Laravel server. Thanks.

Princewil avatar Feb 15 '24 21:02 Princewil