feat: Added file formatting
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanActivateChildFn, RedirectCommand, Router } from '@angular/router';
|
||||
import { LocalStorageService } from './services/local-storage.service';
|
||||
import { inject } from '@angular/core'
|
||||
import { CanActivateChildFn, RedirectCommand, Router } from '@angular/router'
|
||||
import { LocalStorageService } from './services/local-storage.service'
|
||||
|
||||
export const adminGuard: CanActivateChildFn = (childRoute, state) => {
|
||||
const router = inject(Router)
|
||||
if (inject(LocalStorageService).admin == undefined) return new RedirectCommand(router.parseUrl('/'))
|
||||
if (inject(LocalStorageService).admin == undefined)
|
||||
return new RedirectCommand(router.parseUrl('/'))
|
||||
return true
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user