login
This commit is contained in:
36
src/app/modules/user/user-routing.module.ts
Normal file
36
src/app/modules/user/user-routing.module.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {LoginComponent} from './login/login.component';
|
||||
import {InfoComponent} from './info/info.component';
|
||||
import {LogoutComponent} from './logout/logout.component';
|
||||
import {AngularFireAuthGuard, redirectUnauthorizedTo} from '@angular/fire/auth-guard';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'info',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
component: LoginComponent
|
||||
},
|
||||
{
|
||||
path: 'logout',
|
||||
component: LogoutComponent
|
||||
},
|
||||
{
|
||||
path: 'info',
|
||||
component: InfoComponent,
|
||||
canActivate: [AngularFireAuthGuard],
|
||||
data: {authGuardPipe: () => redirectUnauthorizedTo(['user', 'login'])}
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class UserRoutingModule {
|
||||
}
|
||||
Reference in New Issue
Block a user