ngmodule
Configures XSRF protection support for outgoing requests.
class HttpClientXsrfModule {
static disable(): ModuleWithProviders<HttpClientXsrfModule>
static withOptions(options: { cookieName?: string; headerName?: string; } = {}): ModuleWithProviders<HttpClientXsrfModule>
} For a server that supports a cookie-based XSRF protection system, use directly to configure XSRF protection with the correct cookie and header names.
If no names are supplied, the default cookie name is XSRF-TOKEN and the default header name is X-XSRF-TOKEN.
| disable() |
|---|
| Disable the default XSRF protection. |
|
| withOptions() | |||
|---|---|---|---|
| Configure XSRF protection. | |||
|
options | object | An object that can specify either or both cookie name or header name.
Optional. Default is |
| Provider |
|---|
HttpXsrfInterceptor |
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true } |
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor } |
withXsrfConfiguration({
cookieName: XSRF_DEFAULT_COOKIE_NAME,
headerName: XSRF_DEFAULT_HEADER_NAME
}).ɵproviders |
{ provide: XSRF_ENABLED, useValue: true } |
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/common/http/HttpClientXsrfModule