Skip to main content

Posts

Showing posts with the label Configuring Custom Cookie

Angular 9 - Configuring Custom Cookie/Header Names

If your backend service uses different names for the XSRF token cookie or header, use HttpClientXsrfModule.withOptions () to override the defaults. imports : [    HttpClientModule ,    HttpClientXsrfModule . withOptions ({      cookieName:   'My-Xsrf-Cookie' ,      headerName:   'My-Xsrf-Header' ,   }), ], withOptions() - Configure XSRF protection. An object that can specify either or both cookie name or header name. 1.       Cookie name default is XSRF-TOKEN . 2.       Header name default is X-XSRF-TOKEN . static   withOptions ( options : { cookieName? :   string ;  headerName ?:  string ; } = {}):  ModuleWithProviders < HttpClientXsrfModule > HttpClientXsrfModule - Configures XSRF protection support for outgoing requests. class   HttpClientXsrfModu...