Chore: Auth Guard converted to CanActivateFn
This commit is contained in:
1 parent
a095ede3de
commit
b6bb3dbcfd
43 files changed
+231
-398
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule, inject } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { paymentAccountsResolver } from './payment-accounts.resolver';
|
||||
import { PaymentComponent } from './payment.component';
|
||||
@@ -12,9 +12,7 @@ const paymentRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PaymentComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
canActivate: [authGuard],
|
||||
data: {
|
||||
permission: 'journal',
|
||||
},
|
||||
@@ -27,9 +25,7 @@ const paymentRoutes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
component: PaymentComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
canActivate: [authGuard],
|
||||
data: {
|
||||
permission: 'journal',
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user