Base solution for your next web application
Open Closed

Tokens not included in the request header on my components. #9074


User avatar
0
ibrsoft created

Hello, I have a problem and I am not able to solve it.

All requests that I make with my components, simply stopped including the token in the request header. The other existing components remain functioning normally, they are only the components that I created that were affected.

I'm not sure when this problem started, but I noticed right after running commands to create a component with ng cli (eg: ng g c <name-component>).

The strangest thing is that when using another branch (repository) the same component returns to working normally.

I made a comparison between branchs and I couldn't identify any changes that could cause this problem.

I'm using version 8.0.0 aspnet core + angular.

I thank and congratulate you for the excellent tool that is aspnet zero.


1 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hello @ibrsoft,

    Zero uses angular's http interceptors to manage your requests. Normally it is implemented in service-proxy.module.ts (https://github.com/aspnetzero/aspnet-zero-core/blob/3d06e8103c64b2f34e114529371b5aa626ccac46/angular/src/shared/service-proxies/service-proxy.module.ts#L57) and all our services work with that.

    Do you use nswag generated service in your component? If you dont, you should check whether interceptor is provided in your service component.