Open Zhythero opened 4 years ago
Hi @Zhythero
I will make headers
accept a function.
In the meantime you can create a plugin
// nuxt.config.js
export default {
buildModules: [
'@nuxtjs/laravel-echo'
],
echo: {
plugins: ['~/plugins/echo.js']
}
}
// plugins/echo.js
export default function ({ $echo, app }) {
$echo.options.auth.headers['X-XSRF-TOKEN'] = 'TOKEN'
$echo.connect()
}
Hi @Zhythero
Try this version: 2.0.0-alpha.1
Added support for Laravel Sanctum
with auth-module v5
https://github.com/nuxt-community/laravel-echo-module/blob/main/src/runtime/echo.ts#L37
Hi,
So I have this nuxt module installed along with nuxt's axios module. My axios instance is currently having a X-XSRF-TOKEN header configured inside it (because Laravel Sanctum) and I need this module to use the axios instance so that I can authenticate my SPA with Laravel's Broadcasting.