-
Notifications
You must be signed in to change notification settings - Fork 32
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
Echo wont connect after page refresh #56
Comments
here is a plugin I wrote for this work-around until we have an official fix for anyone that would like it. import { Echo } from '@nuxtjs/laravel-echo'
export default async function ({ $echo }: { $echo: Echo }) {
if ($echo.options.broadcaster !== $echo.config.broadcaster) {
$echo.options.broadcaster = $echo.config.broadcaster
await $echo.connect()
}
} |
@ricardogobbosouza any progress on this? |
In which point are You running this script? as a echo plugin or nuxt.config plugins or maybe $auth plugin? |
@devzom an echo plugin: // Doc: https://github.com/nuxt-community/laravel-echo
echo: {
broadcaster: 'pusher',
key: process.env.PUSHER_APP_KEY,
cluster: process.env.PUSHER_APP_CLUSTER,
authEndpoint: `${process.env.API_URL}/broadcasting/auth`,
encrypted: true,
authModule: true,
connectOnLogin: true,
disconnectOnLogout: true,
plugins: [
'@/plugins/echo',
], |
This is still happening on |
Had the same issue, your workaround did not fully work, so I changed a little bit for me. Imported the plugin as you explained, but the params brought me an error, so I switched like this, now working well. Hope it helps others ;)
|
Doing this defies the purpose of connectOnLogin as a connection will be made on page refresh even if the user is not logged in.
|
In order to get echo working after a page refresh I have to do this:
it works when the user logs in, but after a refresh it stops and options.broadcaster is null, and connect isnt run again.
i am on version
alpha5
with the latestauth-next
, my config is:The text was updated successfully, but these errors were encountered: