Only one endpoint is not intercepted by auth interceptor in Angular 17.2.1

Only the api/authentication/reset-password endpoint is not intercepted. Other endpoints and api/authentication/refresh-token are intercepted via authInterceptor as expected.

// srcappadmininterceptorauth.interceptor.ts
import { Routes } from '@angular/router';
import { AdminComponent } from './admin.component';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { serverErrorInterceptor } from './interceptor/server-error.interceptor';
import { AuthService } from './services/auth/auth.service';

export const ADMIN_ROUTES: Routes = [
  {
    path: '',
    component: AdminComponent,
    providers: [AuthService, provideHttpClient(withInterceptors([serverErrorInterceptor]))],
    children: [
      {
        path: 'auth',
        pathMatch: 'full',
        loadComponent: () => import('./auth/auth.component').then((m) => m.AuthComponent),
        title: 'Админ | Авторизация',
      },
      {
        path: '',
        loadChildren: () => import('./admin-shell/admin-shell.routes').then((m) => m.ADMIN_SHELL_ROUTES),
      },
    ],
  },
];
// srcappadminadmin-shelladmin-shell.routes.ts
import { Routes } from '@angular/router';
import { AdminShellComponent } from './admin-shell.component';
import { AuthGuard } from '../guards/auth.guard';
import { RoleEnum } from '../enums/role.enum';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { serverErrorInterceptor } from '../interceptor/server-error.interceptor';
import { authInterceptor } from '../interceptor/auth.interceptor';

//todo: refactor ./ and ../ paths. Also the canActivate with their data.
export const ADMIN_SHELL_ROUTES: Routes = [
  {
    path: '',
    component: AdminShellComponent,
    providers: [provideHttpClient(withInterceptors([serverErrorInterceptor, authInterceptor]))],
    canActivate: [AuthGuard],
    data: { permittedRoles: [RoleEnum.ADMIN, RoleEnum.SUB_ADMIN] },
    title: 'Админ',
    children: [
      { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
      {
        path: 'dashboard',
        loadComponent: () => import('./../pages/dashboard/dashboard.component').then((m) => m.DashboardComponent),
        title: 'Админ - Главная',
      },
      {
        path: 'users',
        canActivate: [AuthGuard],
        data: { permittedRoles: [RoleEnum.ADMIN] },
        loadComponent: () => import('./../pages/users/users.component').then((m) => m.UsersComponent),
        title: 'Админ - Пользователи',
      },
      {
        path: 'orders',
        loadComponent: () => import('./../pages/orders/orders.component').then((m) => m.OrdersComponent),
        title: 'Админ - Заказы',
      },
      {
        path: 'receipts',
        loadComponent: () => import('../pages/receipts/receipts.component').then((m) => m.ReceiptsComponent),
        title: 'Админ - Рецепты',
      },
      {
        path: 'products',
        loadComponent: () => import('./../pages/products/products.component').then((m) => m.ProductsComponent),
        title: 'Админ - Продукты',
      },
      {
        path: 'import-export',
        canActivate: [AuthGuard],
        data: { permittedRoles: [RoleEnum.ADMIN] },
        loadComponent: () =>
          import('./../pages/import-export/import-export.component').then((m) => m.ImportExportComponent),
        title: 'Админ - Перенос данных',
      },
      {
        path: 'advertisements',
        canActivate: [AuthGuard],
        loadComponent: () =>
          import('../pages/advertisements/advertisements.component').then((m) => m.AdvertisementsComponent),
        title: 'Админ - Реклама',
      },
      {
        path: 'categories',
        canActivate: [AuthGuard],
        data: { permittedRoles: [RoleEnum.ADMIN] },
        loadComponent: () => import('./../pages/categories/categories.component').then((m) => m.CategoriesComponent),
        title: 'Админ - Категории',
      },
      {
        path: 'reset-password',
        canActivate: [AuthGuard],
        loadComponent: () =>
          import('../pages/reset-password/reset-password.component').then((m) => m.ResetPasswordComponent),
        title: 'Админ - Сброс пароля',
      },
    ],
  },
];
srcappadmininterceptorauth.interceptor.ts
import { inject } from '@angular/core';
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http';
import { BehaviorSubject, catchError, filter, Observable, switchMap, take, throwError } from 'rxjs';
import { AuthService } from '../services/auth/auth.service';
import { AuthResponse } from '../interfaces/auth-response';
import { InterceptorSkipHeader } from '../../constants/constants';

let isRefreshing = false;
const refreshTokenSubject: BehaviorSubject<string | null> = new BehaviorSubject<string | null>(null);

export function authInterceptor(request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>> {
  console.log('auth interceptor');
  const authService = inject(AuthService);

  if (request.headers.has(InterceptorSkipHeader)) {
    const headers = request.headers.delete(InterceptorSkipHeader);
    return next(request.clone({ headers }));
  }

  if (authService.accessToken()) {
    request = addToken(request, authService.accessToken()!);
  }

  function handle401Error(request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>> {
    if (!isRefreshing) {
      isRefreshing = true;
      refreshTokenSubject.next(null);

      return authService.refreshToken().pipe(
        switchMap((response: AuthResponse) => {
          isRefreshing = false;
          refreshTokenSubject.next(response.accessToken);
          return next(addToken(request, response.accessToken));
        }),
        catchError((error) => {
          isRefreshing = false;
          if (
            error instanceof HttpErrorResponse &&
            error.status === 401 &&
            (error.error?.message === 'Token expired' || error.error?.message === 'Invalid token')
          ) {
            authService.logOut();
          }
          return throwError(() => error);
        }),
      );
    }
    return refreshTokenSubject.pipe(
      filter((token) => token !== null),
      take(1),
      switchMap((token) => next(addToken(request, token!))),
    );
  }

  return next(request).pipe(
    catchError((error: HttpErrorResponse) => {
      if (error.status === 401) {
        return handle401Error(request, next);
      }
      return throwError(() => error);
    }),
  );
}

function addToken(request: HttpRequest<unknown>, token: string) {
  return request.clone({
    setHeaders: {
      Authorization: `Bearer ${token}`,
    },
  });
}

I also have tried to provide AuthService to ADMIN_SHELL_ROUTES providers but this creates to instances of AuthService for ADMIN_ROUTES and ADMIN_SHELL_ROUTES

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật