- Refactor various components for better readability and maintainability. - Update HTML templates to include `alt` attributes for images and `for` attributes for labels. - Implement reactive forms in OTP component and improve token management in AuthService. - Adjust routing to redirect to 'admin/about' by default. - Remove deprecated interceptor implementation and streamline authentication logic. - Add console logs for better debugging during initialization.
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { Routes } from '@angular/router';
|
|
import { OtpComponent } from './auth/otp/otp.component';
|
|
import { authGuard } from './guards/auth-guard';
|
|
import { AdminLayout } from './layout/admin-layout/admin-layout';
|
|
import { About } from './admin/about/about';
|
|
import { Resume } from './admin/resume/resume';
|
|
import { Projects } from './admin/projects/projects';
|
|
|
|
const enum AdminRouteTitles {
|
|
Login = 'Login',
|
|
About = 'About',
|
|
Resume = 'Resume',
|
|
Projects = 'Projects',
|
|
}
|
|
|
|
export const routes: Routes = [
|
|
{
|
|
path: '',
|
|
redirectTo: 'admin/about',
|
|
pathMatch: 'full'
|
|
},
|
|
{
|
|
path: 'admin',
|
|
component: AdminLayout,
|
|
title: 'Admin',
|
|
children: [
|
|
{
|
|
path: 'login',
|
|
component: OtpComponent,
|
|
title: AdminRouteTitles.Login
|
|
},
|
|
{
|
|
path: 'about',
|
|
component: About,
|
|
canActivate: [authGuard],
|
|
title: AdminRouteTitles.About,
|
|
},
|
|
{
|
|
path: 'resume',
|
|
component: Resume,
|
|
canActivate: [authGuard],
|
|
title: AdminRouteTitles.Resume,
|
|
},
|
|
{
|
|
path: 'projects',
|
|
component: Projects,
|
|
canActivate: [authGuard],
|
|
title: AdminRouteTitles.Projects,
|
|
},
|
|
],
|
|
}
|
|
];
|
|
|