import { Routes } from '@angular/router';

import { AuthGuard } from './core/guards/auth.guard';

import { LoginComponent } from './login/login.component';
import { HomeComponent } from './home/home.component';
import { DisconnectionComponent } from './disconnection/disconnection.component';
import { MyPostsComponent } from './posts/myPosts/my-posts.component';
import { AccountSettingsComponent } from './account-settings/account-settings.component';
import { ChangePasswordComponent } from './account-settings/change-password/change-password.component';


export const appRoutes: Routes = [
	{ path: '', redirectTo: '/home', pathMatch: 'full' },
	{ path: 'home', component: HomeComponent },
	{ path: 'login', component: LoginComponent },
	{ path: 'disconnection', component: DisconnectionComponent },
	{ path: 'myPosts', component: MyPostsComponent, canActivate: [AuthGuard] },
	{ path: 'accountSettings', component: AccountSettingsComponent, canActivate: [AuthGuard] },
	{ path: 'changePassword', component: ChangePasswordComponent, canActivate: [AuthGuard] },
	{ path: '**', redirectTo: '/home' }
];
