Skip to content

Commit 7ed576b

Browse files
committed
Revert of CSRF changes.
1 parent ba13599 commit 7ed576b

File tree

3 files changed

+1
-58
lines changed

3 files changed

+1
-58
lines changed

src/app/app.module.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BrowserModule, Title } from "@angular/platform-browser";
22
import { NgModule } from "@angular/core";
33
import { TranslateModule, TranslateLoader } from "@ngx-translate/core";
44
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
5-
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS, HttpClientXsrfModule } from "@angular/common/http";
5+
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
66
import { AppRoutingModule } from "./app-routing.module";
77
import { AppComponent } from "./app.component";
88
import { NavbarModule } from "./navbar/navbar.module";
@@ -31,8 +31,6 @@ import { UserPageComponent } from "./admin/users/user-page/user-page.component";
3131
import { SharedModule } from "@shared/shared.module";
3232
import { PipesModule } from "@shared/pipes/pipes.module";
3333
import { CookieService } from "ngx-cookie-service";
34-
import { CsrfInterceptor } from "@shared/helpers/csrf-interceptor";
35-
import { CsrfCookieName, CsrfHeaderName } from "@shared/constants/csrf-constants";
3634

3735
export function HttpLoaderFactory(http: HttpClient) {
3836
return new TranslateHttpLoader(http, "./assets/i18n/", ".json");
@@ -81,11 +79,6 @@ export function tokenGetter() {
8179
MonacoEditorModule.forRoot(),
8280
WelcomeDialogModule,
8381
PipesModule,
84-
HttpClientXsrfModule,
85-
HttpClientXsrfModule.withOptions({
86-
cookieName: CsrfCookieName, // Match the cookie name used by the backend
87-
headerName: CsrfHeaderName, // Match the header name expected by the backend
88-
}),
8982
],
9083
bootstrap: [AppComponent],
9184
exports: [TranslateModule],
@@ -94,7 +87,6 @@ export function tokenGetter() {
9487
//{ provide: ErrorHandler, useClass: GlobalErrorHandler },
9588
//{ provide: HTTP_INTERCEPTORS, useClass: ServerErrorInterceptor, multi: true },
9689
Title,
97-
{ provide: HTTP_INTERCEPTORS, useClass: CsrfInterceptor, multi: true },
9890
{ provide: HTTP_INTERCEPTORS, useClass: AuthJwtInterceptor, multi: true },
9991
{ provide: SAVER, useFactory: getSaver },
10092
{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlDa },

src/app/shared/constants/csrf-constants.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/app/shared/helpers/csrf-interceptor.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)