balderdashy/angularSails

Interceptors not applying headers

Closed this issue · 4 comments

I'm having a problem applying the following interceptor to sailsSocket.

Given the following in my config block:

$sailsSocketProvider.interceptors.push(function($q){
    return {
        request: function(config){
            $sailsSocketProvider.defaults.headers.foo = "bar";
            return config;
        }
    }
});

The interceptor is firing, I can see from chrome inspector that the interceptors are not being applied to the outgoing requests.

@robertmain I apologize for the delay in getting back to you. Have you found your answer in another post?

Sadly not. I just appended the token to the query string instead and that fixed it I guess but it's a shame that I can't use headers :-(

We will mark this as a feature request and close this up. Let us know if you have any more questions.

This would be amazing! I'm trying to tie in angular-jwt's Interceptor for JWT authentication.