Closed Icon003 closed 3 years ago
@Icon003 Hi, If you have found a solution, please tell me, I also faced the same problem?
need cherry-pick this commit https://github.com/esbol-moldrakhmetov/laravel-echo/commit/55c955114739a11e1709308d18faa3d84231a4c7
@esbol-moldrakhmetov Hello, you can use my fork https://github.com/Icon003/laravel-echo/tree/feat/auth-v5
@esbol-moldrakhmetov Or replace the line I'm talking about with, const token = app.$auth.strategy.token.get() Now again in a different way
@ricardogobbosouza Hey, I just forked the plugin to be compatible with nuxtjs/auth-next, too. Maybe you could add a small auth-next branch here or (better) a plugin config option for enabling auth-next.
Hello, when using @nuxtjs/auth-next, getting a token does not work. To make this work, you need to make changes to laravel-echo/lib/plugin.js on line 16.
Replace
const token = app.$auth.getToken(strategy.name)
withconst token = app.$auth.token.get(strategy.name)
...till couple days auth is working... not the best way, but working for me.
auth: { ... plugins: [ { src: '~/plugins/auth.js', ssr: false } ] }
import * as Cookies from 'js-cookie' export default function ({ $auth }) { // Set name & Function == Hack it anyway $auth.strategy.options.tokenName = 'X-XSRF-TOKEN' $auth.getToken = (name) => { return Cookies.get('XSRF-TOKEN') || '' } }
Try alpha version 2.0.0-alpha.0
Hello Nuxt Community, are you planning to release a stable v2.0.0 of laravel-echo-module compatible with @nuxtjs/auth-next ?
Hello, when using @nuxtjs/auth-next, getting a token does not work. To make this work, you need to make changes to laravel-echo/lib/plugin.js on line 16.
Replace
const token = app.$auth.getToken(strategy.name)
withconst token = app.$auth.token.get(strategy.name)