yozzz
yozzz

Reputation: 1277

Pusher subscribe private channel - Couldn't get auth info

I'm connecting to private channel as client, it goes to my app API with authentication process like written in docs "Authenticating users", and response with this - {"auth":"3h23kjh322kknkjsad:ea5dc004619ccg23s2e059f740h66684dd887fbexc8d8e56ae23b788cdafa1b"}, response status 201.

But console log says next:

Pusher : State changed : connecting -> connected
Pusher : Couldn't get auth info from your webapp : 201
Pusher : Event sent : {"event":"pusher:ping","data":{}}
Pusher : Event recd : {"event":"pusher:pong","data":{}}

So I have no idea what to do, response is ok

My JS:

Pusher.log = function(message) {
  if (window.console && window.console.log) {
    window.console.log(message);
  }
};

var pusher =
  new Pusher('3h23kjh322kknkjsad', {
              authEndpoint : 'http://localhost:3000/pusher/auth',
              auth: {
                headers : { 'Authorization':'bb692c03c2d8402ca3a5' }
              }
             });

var channel = pusher.subscribe('private-live_admin');
channel.bind('update', function(data) {
  alert(data);
});

Upvotes: 0

Views: 2983

Answers (1)

yozzz
yozzz

Reputation: 1277

Well problem was with status code 201 that was returning by my API. pusher-js lib expects only status with code 200

Upvotes: 1

Related Questions