Problem with authenticating WebSockets

What does the web request that the JavaScript makes to initiate the WebSocket look like? It will include token as a GET parameter.

Your initial request makes it look like token is being passed up, but then a second request is made that fails. Do you have 2 Socket connections by chance?

Why does "token" => "eyJhbGciOiJIUzU..." differ from the second call? Why are there 2 calls at all?

Few high level thoughts are that you are on an old serializer version (1 instead of 2) and using phoenix-socket library. I would suggest making sure you’re on the latest versions possible—in general a good thing—although that is likely not the actual issue at hand.

edit: Have you tried console.log(this.token) in the mounted function? What if it is being mounted without a token?