diff --git a/src/app/app.component.ts b/src/app/app.component.ts
deleted file mode 100644
index b7354c015..000000000
--- a/src/app/app.component.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-import { HeaderComponent } from './core/layout/header.component';
-import { RouterOutlet } from '@angular/router';
-import { FooterComponent } from './core/layout/footer.component';
-
-@Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- imports: [HeaderComponent, RouterOutlet, FooterComponent],
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class AppComponent {}
diff --git a/src/app/app.config.ts b/src/app/app.config.ts
index 73081d770..c8e9230c4 100644
--- a/src/app/app.config.ts
+++ b/src/app/app.config.ts
@@ -3,11 +3,11 @@ import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
-import { JwtService } from './core/auth/services/jwt.service';
-import { UserService, AuthState } from './core/auth/services/user.service';
-import { apiInterceptor } from './core/interceptors/api.interceptor';
-import { tokenInterceptor } from './core/interceptors/token.interceptor';
-import { errorInterceptor } from './core/interceptors/error.interceptor';
+import { Jwt } from './core/auth/services/jwt';
+import { UserAuth, AuthState } from './core/auth/services/user-auth';
+import { apiInterceptor } from './core/interceptors/api-interceptor';
+import { tokenInterceptor } from './core/interceptors/token-interceptor';
+import { errorInterceptor } from './core/interceptors/error-interceptor';
import { EMPTY } from 'rxjs';
import { User } from './core/auth/user.model';
@@ -30,7 +30,7 @@ declare global {
/**
* Sets up the debug interface on window.__conduit_debug__
*/
-function setupDebugInterface(jwtService: JwtService, userService: UserService): void {
+function setupDebugInterface(jwtService: Jwt, userService: UserAuth): void {
let currentAuthState: AuthState = 'loading';
let currentUser: User | null = null;
@@ -53,7 +53,7 @@ function setupDebugInterface(jwtService: JwtService, userService: UserService):
* - 4XX → 'unauthenticated' (invalid token, cleared)
* - 5XX → 'unavailable' (server down, token kept, auto-retry)
*/
-export function initAuth(jwtService: JwtService, userService: UserService) {
+export function initAuth(jwtService: Jwt, userService: UserAuth) {
return () => {
setupDebugInterface(jwtService, userService);
@@ -72,7 +72,7 @@ export const appConfig: ApplicationConfig = {
provideRouter(routes),
provideHttpClient(withInterceptors([apiInterceptor, tokenInterceptor, errorInterceptor])),
provideAppInitializer(() => {
- const initializerFn = initAuth(inject(JwtService), inject(UserService));
+ const initializerFn = initAuth(inject(Jwt), inject(UserAuth));
return initializerFn();
}),
],
diff --git a/src/app/app.component.html b/src/app/app.html
similarity index 100%
rename from src/app/app.component.html
rename to src/app/app.html
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 4d897d1d1..8459361d5 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -1,6 +1,6 @@
import { Router, Routes } from '@angular/router';
import { inject } from '@angular/core';
-import { UserService } from './core/auth/services/user.service';
+import { UserAuth } from './core/auth/services/user-auth';
import { map } from 'rxjs/operators';
/**
@@ -8,31 +8,31 @@ import { map } from 'rxjs/operators';
*/
const requireAuth = () => {
const router = inject(Router);
- return inject(UserService).isAuthenticated.pipe(map(isAuth => isAuth || router.createUrlTree(['/login'])));
+ return inject(UserAuth).isAuthenticated.pipe(map(isAuth => isAuth || router.createUrlTree(['/login'])));
};
export const routes: Routes = [
{
path: '',
- loadComponent: () => import('./features/article/pages/home/home.component'),
+ loadComponent: () => import('./features/article/pages/home/home'),
},
{
path: 'tag/:tag',
- loadComponent: () => import('./features/article/pages/home/home.component'),
+ loadComponent: () => import('./features/article/pages/home/home'),
},
{
path: 'login',
- loadComponent: () => import('./core/auth/auth.component'),
- canActivate: [() => inject(UserService).isAuthenticated.pipe(map(isAuth => !isAuth))],
+ loadComponent: () => import('./core/auth/auth'),
+ canActivate: [() => inject(UserAuth).isAuthenticated.pipe(map(isAuth => !isAuth))],
},
{
path: 'register',
- loadComponent: () => import('./core/auth/auth.component'),
- canActivate: [() => inject(UserService).isAuthenticated.pipe(map(isAuth => !isAuth))],
+ loadComponent: () => import('./core/auth/auth'),
+ canActivate: [() => inject(UserAuth).isAuthenticated.pipe(map(isAuth => !isAuth))],
},
{
path: 'settings',
- loadComponent: () => import('./features/settings/settings.component'),
+ loadComponent: () => import('./features/settings/settings'),
canActivate: [requireAuth],
},
{
@@ -44,18 +44,18 @@ export const routes: Routes = [
children: [
{
path: '',
- loadComponent: () => import('./features/article/pages/editor/editor.component'),
+ loadComponent: () => import('./features/article/pages/editor/editor'),
canActivate: [requireAuth],
},
{
path: ':slug',
- loadComponent: () => import('./features/article/pages/editor/editor.component'),
+ loadComponent: () => import('./features/article/pages/editor/editor'),
canActivate: [requireAuth],
},
],
},
{
path: 'article/:slug',
- loadComponent: () => import('./features/article/pages/article/article.component'),
+ loadComponent: () => import('./features/article/pages/article/article'),
},
];
diff --git a/src/app/app.ts b/src/app/app.ts
new file mode 100644
index 000000000..06bb79003
--- /dev/null
+++ b/src/app/app.ts
@@ -0,0 +1,12 @@
+import { ChangeDetectionStrategy, Component } from '@angular/core';
+import { Header } from './core/layout/header';
+import { RouterOutlet } from '@angular/router';
+import { Footer } from './core/layout/footer';
+
+@Component({
+ selector: 'app-root',
+ templateUrl: './app.html',
+ imports: [Header, RouterOutlet, Footer],
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class App {}
diff --git a/src/app/core/auth/auth.component.html b/src/app/core/auth/auth.html
similarity index 76%
rename from src/app/core/auth/auth.component.html
rename to src/app/core/auth/auth.html
index 81cd85d6d..640e8e23e 100644
--- a/src/app/core/auth/auth.component.html
+++ b/src/app/core/auth/auth.html
@@ -5,11 +5,9 @@
{{ title }}
@if (authType === 'register') {
- Have an account?
- }
-
- @if (authType === 'login') {
- Need an account?
+ Have an account?
+ } @if (authType === 'login') {
+ Need an account?
}
@@ -17,12 +15,12 @@ {{ title }}