Skip to content

PusherService configuration outside config block. Is it possible? #26

@willian

Description

@willian

First of all, thanks for this library @doowb.

I have something like this:

var userAuthenticationToken = window.sessionStorage.authenticationToken;
if (userAuthenticationToken !== '') {
  PusherServiceProvider
    .setToken(PUSHER_KEY)
    .setOptions({
      authEndpoint: API_URL + '/v1/pusher/auth',
      auth: {
        headers: {
          'Authorization': 'Token token=' + userAuthenticationToken
        }
      }
    });
}

That's because my Backend API requires an authenticated user in order to authenticate Pusher.

The problem is: sometimes usre is not logged in, so I show a sign in form to him, he logs in and I can't make a request to authenticate Pusher because .config block can't be called any more.

Is there a way to call PusherService in order to make an authentication again?

Thanks in advance for any help :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions