Angular 4.3 XSRF HttpClientModule

I am implementing CSRF protection in my angular project. I upgraded to 4.3, and according to the HttpClientModule docs:

https://angular.io/guide/http#security-xsrf-protection

I need to implement,

 HttpClientXsrfModule.withConfig({
cookieName: 'My-Xsrf-Cookie',
headerName: 'My-Xsrf-Header',
  }),

      

I did it, however the compiler is complaining:

Property 'withConfig' does not exist for type 'typeof HttpClientXsrfModule'.

+3


source to share


1 answer


it is a text input problem in the documentation.

You need to use "withOptions" instead.



HttpClientXsrfModule.withOptions({
  cookieName: 'My-Xsrf-Cookie',
  headerName: 'My-Xsrf-Header',
})

      

+9


source







All Articles