Skip to content
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

AuthError after migrating from Laravel 10 to 11 on Private Channel #284

Open
jonjakoblich opened this issue Dec 17, 2024 · 6 comments
Open

Comments

@jonjakoblich
Copy link

Reverb Version

1.4.4

Laravel Version

11.35.1

PHP Version

8.3.12

Description

After having an existing Laravel 10 application, and following the migration steps to upgrade to Laravel 11, I get the following error when listening to a private channel.

Object { type: "AuthError", error: "JSON returned from channel-authorization endpoint was invalid, yet status code was 200. Data was: ", status: 200 }

This private channel was previously working without error before upgrading.

This is occurring on my machine running Laravel Herd.
Screenshot 2024-12-17 at 6 59 58 AM

Steps To Reproduce

Demo repo: https://github.com/jonjakoblich/reverb-10

Steps taken in repository

  1. Install fresh Laravel 10 application with latest Laravel 10 version
  2. Install Jetstream w/ Inertia-Vue
  3. Create an event to test
  4. Modify welcome page to listen to event
  5. Upgrade to Laravel 11

To reproduce

  1. Clone the repository linked above
  2. Install and run the site using Laravel Herd (not tested in other environments)
  3. Install composer packages, node packages, run migrations
  4. Run npm run build
  5. Register a user (& be logged in since the private channel is related to the user)
  6. Navigate to welcome page (should be base URL of the newly installed app)
  7. Open Tinker and run the test event broadcast(new MyTestEvent(User::find(1)));
  8. Inspect in the console to see the error
  9. Inspect the network tab to see that the web socket connection was not the expected response
@joedixon
Copy link
Collaborator

Hey @jonjakoblich, which URL is being requested when that error is returned?

@jonjakoblich
Copy link
Author

jonjakoblich commented Dec 19, 2024

Hey @jonjakoblich, which URL is being requested when that error is returned?

@joedixon Home page.

@joedixon
Copy link
Collaborator

Thanks, but I meant is that request failing on the broadcasting/auth endpoint or connecting to the WebSocket server itself. Are you able to show the failing request in the network tab?

@jonjakoblich
Copy link
Author

Thanks, but I meant is that request failing on the broadcasting/auth endpoint or connecting to the WebSocket server itself. Are you able to show the failing request in the network tab?

@joedixon I'm attaching a few additional screenshots here of the broadcasting/auth endpoint. Hopefully this helps. Let me know if you need something else.

Screenshot 2024-12-19 at 3 45 51 PM Screenshot 2024-12-19 at 3 46 00 PM Screenshot 2024-12-19 at 3 46 09 PM

@joedixon
Copy link
Collaborator

I'm sorry, it's still not clear to me where the error is being generated. Are any of the network requests returning failed status codes?

@jonjakoblich
Copy link
Author

I'm sorry, it's still not clear to me where the error is being generated. Are any of the network requests returning failed status codes?

@joedixon No, they are not. The blue highlighted request in each of those screenshots is the request. You can see the 101 status in the first one (the web socket connection I believe) and the 200 status in the successive ones on each (the /broadcasting/auth endpoint). The screenshots are from Firefox Developer Edition. Beyond that, I've not been able to trace the error. It looks like it connects to the /broadcasting/auth endpoint, gets a 200 response, but not the anticipated data back.

I don't know if you've had a chance to clone and install the demo repo I provided, but that does illustrate the issue when using Laravel Herd. I have not tried other setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants