syncthing/next-gen-gui/src/app/http-interceptors/index.ts

14 lines
637 B
TypeScript
Raw Normal View History

/* "Barrel" of Http Interceptors */
import { HTTP_INTERCEPTORS } from '@angular/common/http';
2020-03-25 00:19:54 +01:00
import { CSRFInterceptor } from './csrf.interceptor';
import { CachingInterceptor } from './caching.interceptor';
2020-04-06 20:32:27 +02:00
import { ErrorInterceptor } from './error.interceptor';
/** Http interceptor providers in outside-in order */
export const httpInterceptorProviders = [
2020-03-25 00:19:54 +01:00
{ provide: HTTP_INTERCEPTORS, useClass: CachingInterceptor, multi: true },
2020-04-06 20:32:27 +02:00
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
2020-03-25 00:19:54 +01:00
// CSRFInterceptor needs to be last
{ provide: HTTP_INTERCEPTORS, useClass: CSRFInterceptor, multi: true },
];