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

Pusher error #67

Closed
folkevil opened this issue Jul 15, 2017 · 5 comments
Closed

Pusher error #67

folkevil opened this issue Jul 15, 2017 · 5 comments

Comments

@folkevil
Copy link

I got this error in console
,
Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":null,"message":"Invalid key in subscription auth data: 'xxxxxxxxx'"}}},

All configs for pusher are correct but i don't know why.

@saleh-old
Copy link
Contributor

You must enter pusher info in both .env file and bootstrap.js (I should later refactor it so .env would be enough). Have you done this?

@folkevil
Copy link
Author

Yes, I did it already but still got that error.

@saleh-old
Copy link
Contributor

Please leave me the info your .env and bootstrap.js files. (the pusher sections)

@folkevil
Copy link
Author

folkevil commented Jul 16, 2017

.env

PUSHER_APP_ID=367728
PUSHER_KEY=06c41f61970777fdxxxx
PUSHER_SECRET=6a8493659157863xxxx
PUSHER_CLUSTER=us2

and bootstrap.js


if (Laravel.env == 'local') {
	window.Echo = new Echo({
	    broadcaster: 'pusher',
	    key: '06c41f61970777fdxxxx',
	    cluster: 'us2'
	});
} else if (Laravel.env == 'production') {
    window.Echo = new Echo({
        broadcaster: 'pusher',
        key: '2801f0d58cd36d94xxxx',
        cluster: 'us2'
    });
} else {
	window.Echo = new Echo({
	    broadcaster: 'socket.io',
	    host: 'https://echo.voten.dev:6001',
	    auth:
	    {
	        headers:
	        {
	            'Authorization': 'Bearer ' + 'nb35mdq2ca9928qgl4sgjf3imil5811sn41qsmcaph0p3h6sa5ht8hoktdeg'
	        }
	    }
	});
}

@saleh-old
Copy link
Contributor

Turns out there was another file(config/broadcasting.php) that needed to be manually edited. I pushed an update, removing the need for manual editions. Just pull latest code, enter only .env values and you're good to go. (notice a PUSHER_CLUSTER key has been added to .env.example).

P.S: in case you're going to broadcast notifications, you should also edit this file as I explained. See if your can find a fix for it (so the manual edit wouldn't be needed) and let me know of it. thanks

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