I'm implementing CSRF protection within my angular project. I've upgraded to 4.3, and according to HttpClientModule docs at:
https://angular.io/guide/http#security-xsrf-protection
I have to implement,
HttpClientXsrfModule.withConfig({
cookieName: 'My-Xsrf-Cookie',
headerName: 'My-Xsrf-Header',
}),
I've done so, however the compiler complains:
Property 'withConfig' does not exist on type 'typeof HttpClientXsrfModule'.
this is a typing issue in the documentation.
You need to use "withOptions" instead.
HttpClientXsrfModule.withOptions({
cookieName: 'My-Xsrf-Cookie',
headerName: 'My-Xsrf-Header',
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With