WIP
This commit is contained in:
@@ -5,13 +5,16 @@ import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
import { authInterceptor } from './core/interceptors/auth.interceptor';
|
||||
import { httpErrorInterceptor } from './core/interceptors/http-error.interceptor';
|
||||
import { AuthService } from './shared/services/auth.service';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideRouter(routes),
|
||||
provideAnimations(),
|
||||
provideHttpClient(withInterceptors([authInterceptor])),
|
||||
// httpErrorInterceptor is listed first so its catchError runs LAST (outermost),
|
||||
// i.e. after authInterceptor has handled/retried 401s.
|
||||
provideHttpClient(withInterceptors([httpErrorInterceptor, authInterceptor])),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: (authService: AuthService) => () => authService.initializeFromRefreshToken(),
|
||||
|
||||
Reference in New Issue
Block a user