Replace CSRF source from cookie to header in the console requests (#3047)

* Update XSRF cookie to be a header

* Replace CSRF cookie with header
This commit is contained in:
Pavlo Tkach
2026-05-15 17:45:33 +00:00
committed by GitHub
parent 0998d5485c
commit d30cc202d2
4 changed files with 19 additions and 20 deletions
+10 -2
View File
@@ -23,7 +23,11 @@ import { MaterialModule } from './material.module';
import { BackendService } from './shared/services/backend.service';
import { provideHttpClient } from '@angular/common/http';
import {
HttpClientXsrfModule,
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { BillingInfoComponent } from './billingInfo/billingInfo.component';
import {
@@ -118,6 +122,10 @@ export class SelectedRegistrarModule {}
MaterialModule,
SelectedRegistrarModule,
SnackBarModule,
HttpClientXsrfModule.withOptions({
cookieName: 'X-CSRF-Token',
headerName: 'X-CSRF-Token',
}),
],
providers: [
BackendService,
@@ -130,7 +138,7 @@ export class SelectedRegistrarModule {}
subscriptSizing: 'dynamic',
},
},
provideHttpClient(),
provideHttpClient(withInterceptorsFromDi()),
],
})
export class AppModule {}