diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 4218e6faa..46e335b8f 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -55,6 +55,7 @@ import { ILoggerConfig } from '@red/domain'; import { SystemPreferencesService } from '@services/system-preferences.service'; import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module'; import { LicenseService } from '@services/license.service'; +import { TenantIdInterceptor } from '@utils/tenant-id-interceptor'; export function httpLoaderFactory(httpClient: HttpClient, configService: ConfigService): PruningTranslationLoader { return new PruningTranslationLoader(httpClient, '/assets/i18n/', `.json?version=${configService.values.FRONTEND_APP_VERSION}`); @@ -168,6 +169,11 @@ const components = [AppComponent, AuthErrorComponent, NotificationsComponent, Sp multi: true, useClass: ApiPathInterceptor, }, + { + provide: HTTP_INTERCEPTORS, + multi: true, + useClass: TenantIdInterceptor, + }, { provide: HTTP_INTERCEPTORS, multi: true, diff --git a/apps/red-ui/src/app/utils/tenant-id-interceptor.ts b/apps/red-ui/src/app/utils/tenant-id-interceptor.ts new file mode 100644 index 000000000..a53ed2163 --- /dev/null +++ b/apps/red-ui/src/app/utils/tenant-id-interceptor.ts @@ -0,0 +1,13 @@ +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; + +@Injectable() +export class TenantIdInterceptor implements HttpInterceptor { + intercept(req: HttpRequest, next: HttpHandler): Observable> { + const updatedRequest = req.clone({ + setHeaders: { 'X-TENANT-ID': 'redaction' }, + }); + return next.handle(updatedRequest); + } +}