RED-6117 - Integrate tenant request header
This commit is contained in:
parent
f36b124fdf
commit
e9be251ae2
@ -3,6 +3,8 @@ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } fr
|
||||
import { Observable } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
|
||||
const VALID_TENANT_IDS = ['redaction'];
|
||||
|
||||
@Injectable()
|
||||
export class TenantIdResponseInterceptor implements HttpInterceptor {
|
||||
intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
@ -10,7 +12,9 @@ export class TenantIdResponseInterceptor implements HttpInterceptor {
|
||||
tap(event => {
|
||||
if (event instanceof HttpResponse) {
|
||||
const xTenantId = event.headers.get('X-TENANT-ID');
|
||||
//TODO check tenant id when backend will be done
|
||||
if (VALID_TENANT_IDS.includes(xTenantId)) {
|
||||
//TODO add logic to deny the response when backend will send the header
|
||||
}
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user