Chore: Auth Guard converted to CanActivateFn
This commit is contained in:
@ -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 { EmployeeFunctionsComponent } from './employee-functions.component';
|
||||
|
||||
@ -10,9 +10,7 @@ const employeeFunctionsRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EmployeeFunctionsComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
canActivate: [authGuard],
|
||||
data: {
|
||||
permission: 'employee-benefit',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user