Skip to content

Commit 881985f

Browse files
committed
chore(auth): move guards and interceptors to features/authentication module
- Refactored to relocate authentication-related guards and interceptors - Updated imports across the app to align with the new structure.
1 parent 4566b61 commit 881985f

9 files changed

Lines changed: 5 additions & 5 deletions

src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/
1919
import { cachingInterceptor } from '~core/interceptors/caching.interceptor';
2020
import { appRoutes } from './app.routes';
2121
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
22-
import { authenticationInterceptor } from '~core/interceptors/authentication.interceptor';
22+
import { authenticationInterceptor } from '~features/authentication/authentication.interceptor';
2323
import { provideCloudinaryLoader } from '@angular/common';
2424
import { ENVIRONMENT } from '~core/tokens/environment.token';
2525
import { environment } from '~environments/environment';

src/app/app.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '~core/constants/paths.constants';
88
import type { Route } from '@angular/router';
99
import { ERROR_URLS } from '~core/constants/urls.constants';
10-
import { authenticationGuard } from '~core/guards/authentication.guard';
10+
import { authenticationGuard } from '~features/authentication/guards/authentication.guard';
1111

1212
export const appRoutes: Route[] = [
1313
{

src/app/core/interceptors/authentication.interceptor.spec.ts renamed to src/app/features/authentication/authentication.interceptor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { TestBed } from '@angular/core/testing';
44
import { Router } from '@angular/router';
55
import { beforeEach, describe, expect, it, vi } from 'vitest';
66
import { of, throwError } from 'rxjs';
7-
import { authenticationInterceptor } from './authentication.interceptor';
87
import { AuthenticationService } from '~features/authentication/services/authentication.service';
98
import { AlertService } from '~core/services/ui/alert.service';
109
import { LOCAL_STORAGE } from '~core/providers/local-storage';
1110
import { AUTH_URLS } from '~core/constants/urls.constants';
1211
import { AppError } from '~core/enums/app-error.enums';
12+
import { authenticationInterceptor } from '~features/authentication/authentication.interceptor';
1313

1414
describe('authenticationInterceptor', () => {
1515
let mockAuthService: { refreshToken: ReturnType<typeof vi.fn>; logOut: ReturnType<typeof vi.fn> };

src/app/core/interceptors/authentication.interceptor.ts renamed to src/app/features/authentication/authentication.interceptor.ts

File renamed without changes.

src/app/features/authentication/authentication.routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { LogInComponent } from '~features/authentication/pages/log-in/log-in.component';
22
import { RegisterComponent } from '~features/authentication/pages/register/register.component';
3-
import { noAuthenticationGuard } from '~core/guards/no-authentication.guard';
43
import { AUTHENTICATION_PATHS } from '~core/constants/paths.constants';
5-
import { authenticationGuard } from '~core/guards/authentication.guard';
64
import { MyAccountComponent } from '~features/authentication/pages/my-account/my-account.component';
5+
import { noAuthenticationGuard } from '~features/authentication/guards/no-authentication.guard';
6+
import { authenticationGuard } from '~features/authentication/guards/authentication.guard';
77

88
export const AUTHENTICATION_ROUTES = [
99
{

src/app/core/guards/authentication.guard.spec.ts renamed to src/app/features/authentication/guards/authentication.guard.spec.ts

File renamed without changes.
File renamed without changes.

src/app/core/guards/no-authentication.guard.spec.ts renamed to src/app/features/authentication/guards/no-authentication.guard.spec.ts

File renamed without changes.

src/app/core/guards/no-authentication.guard.ts renamed to src/app/features/authentication/guards/no-authentication.guard.ts

File renamed without changes.

0 commit comments

Comments
 (0)