Set auth header after config phase
Is it possible to set the auth header after angular's config phase (i.e. without going through PusherServiceProvider). At the configuration stage I still don't have the token.
It's currently being used as soon as you "get" the Pusher factory in your controller. I think the code can be refactored to wait to call the actual Pusher api and allow passing in the token from your controller.
I might have some time to make that change later, but it might not be until this weekend.
Ok, I see. Thanks for the quick reply.
@finishingmove how did you solve this for you? I need to work with WSSE headers.
@clicktrend I went with a custom solution. I created a simple Pusher wrapper that accepts my token service as a dependency. My Pusher factory then returns a promise that is resolved when the token is resolved. So I can use it in my controllers like this:
Pusher.then(function resolved(PusherInstance) {
PusherInstance.doWhatever(...);
});
@finishingmove could you provide the code for your factory? I'm trying to achieve the same thing but can't really figure it out.
@finishingmove I'd like to see your solution also.