title: Laravel Echo + Pusher subscription_error on private channel
body: <p>I can't manage to get echo and pusher working when using private channels, googled for two days and found nada.</p>
  
  <p>What seems to be happening is some sort of problem with the authentication (I'm using Laravel basic Auth) cause I can subscribe to public channels</p>
  
  <p><strong>routes/channels.php</strong> </p>
  
  <pre><code>Broadcast::channel('private-ci-received-{userId}', function ($user, $userId) {
      return (int) $user-&gt;id === (int) $userId;
  });
  
  Broadcast::channel('private-ci-received-{toUserId}', function ($currentUser, $toUserId) {
      return true;
  });
  </code></pre>
  
  <p><strong>bootstrap.js</strong></p>
  
  <pre><code>import Echo from 'laravel-echo'
  
   window.Pusher = require('pusher-js');
  
   window.Echo = new Echo({
  
       broadcaster: 'pusher',
       key: process.env.MIX_PUSHER_APP_KEY,
       cluster: process.env.MIX_PUSHER_APP_CLUSTER,
       logToConsole: true,
       encrypted: true,
   });
  </code></pre>
  
  <p><strong>default.blade.php(main layout)</strong></p>
  
  <pre><code>        Pusher.logToConsole = true;
          Echo.logToConsole = true;
  
          Echo.private('ci-received-{{ Auth::user()-&gt;id}}')
              .listen('.CIReceived', (e) =&gt; {
                  console.log(e);
              });
  </code></pre>
  
  <p>What get printed on the console is :</p>
  
  <pre><code>Pusher : No callbacks on private-ci-received-1 for pusher:subscription_error
  </code></pre>
  
  <p>It's a pretty generic error, then for debug purposes I tried to bind the error using Pusher (not laravel echo)</p>
  
  <pre><code>var pusher = new Pusher('MYSECRETAPPKEYHERE', {
              cluster: 'us2',
              forceTLS: true
          });
  
          var channel = pusher.subscribe('private-ci-received-1');
          channel.bind('pusher:subscription_error', function(data) {
              console.log(data);
          });
  </code></pre>
  
  <p><strong>console.log(data) output</strong></p>
  
  <pre><code>JSON returned from webapp was invalid, yet status code was 200
  </code></pre>
  
  <p>The default authEndPoint is /broadcasting/auth IIRC I think it expects to return a JSON but instead it returns the HTML CODE from my page. </p>
  
  <p>Those routes are created by the framework itself and from what I've read Laravel echo and Laravel Auth should work great together without much fiddling.</p>
  
  <p>My .env file is correct i'm using pusher as broadcast driver and BroadcastServiceProvider is properly uncommented.</p>
  
  <p>Can anyone shed a light in the matter? Thanks</p>