Redid 404 and 500 routing, and redid authguard to point to /login
This commit is contained in:
parent
20330bc220
commit
8939c18335
3 changed files with 18 additions and 20 deletions
|
@ -15,7 +15,7 @@ export class AuthGuard implements CanActivate {
|
|||
|
||||
// not logged in so redirect to login page with the return url
|
||||
console.log('no session key found')
|
||||
this.router.navigate(['/pages/login'], { queryParams: { returnUrl: state.url }});
|
||||
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -21,6 +21,10 @@ import { AuthGuard } from './_guards/auth.guard';
|
|||
import { FullLayoutComponent } from './layouts/full-layout.component';
|
||||
import { SimpleLayoutComponent } from './layouts/simple-layout.component';
|
||||
|
||||
// Error Pages
|
||||
import { P404Component } from './pages/404.component';
|
||||
import { P500Component } from './pages/500.component';
|
||||
|
||||
// Submodules
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
|
||||
|
@ -42,6 +46,8 @@ import { AuthModule } from './auth/auth.module';
|
|||
BreadcrumbsComponent,
|
||||
SIDEBAR_TOGGLE_DIRECTIVES,
|
||||
AsideToggleDirective,
|
||||
P404Component,
|
||||
P500Component,
|
||||
],
|
||||
providers: [
|
||||
AuthGuard,
|
||||
|
|
|
@ -6,10 +6,13 @@ import { AuthGuard } from './_guards/auth.guard';
|
|||
import { FullLayoutComponent } from './layouts/full-layout.component';
|
||||
import { SimpleLayoutComponent } from './layouts/simple-layout.component';
|
||||
|
||||
import { P404Component } from './pages/404.component';
|
||||
import { P500Component } from './pages/500.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'dashboard',
|
||||
redirectTo: '/dashboard',
|
||||
pathMatch: 'full',
|
||||
},
|
||||
{
|
||||
|
@ -38,19 +41,8 @@ export const routes: Routes = [
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'pages',
|
||||
component: SimpleLayoutComponent,
|
||||
data: {
|
||||
title: 'Pages'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: './pages/pages.module#PagesModule',
|
||||
}
|
||||
]
|
||||
}
|
||||
{ path: '404', component: P404Component },
|
||||
{ path: '500', component: P500Component },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
Reference in a new issue