| 136 | */ |
| 137 | @Injectable() |
| 138 | export class HttpXsrfInterceptor implements HttpInterceptor { |
| 139 | private readonly injector = inject(EnvironmentInjector); |
| 140 | |
| 141 | intercept(initialRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
| 142 | return runInInjectionContext(this.injector, () => |
| 143 | xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)), |
| 144 | ); |
| 145 | } |
| 146 | } |