From 5b01aac7a96f7fc070d6dc9a980b4ecda37b65b5 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Tue, 26 Nov 2024 16:15:22 -0700 Subject: [PATCH] add network guard --- .../src/app/internal/shared/guards/network.guard.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 projects/nshmp-apps/src/app/internal/shared/guards/network.guard.ts diff --git a/projects/nshmp-apps/src/app/internal/shared/guards/network.guard.ts b/projects/nshmp-apps/src/app/internal/shared/guards/network.guard.ts new file mode 100644 index 000000000..0fdabaaea --- /dev/null +++ b/projects/nshmp-apps/src/app/internal/shared/guards/network.guard.ts @@ -0,0 +1,12 @@ +import {inject} from '@angular/core'; +import {CanActivateFn} from '@angular/router'; + +import {AuthService} from '../services/auth.service'; + +/** + * Network auth route guard. + */ +export const networkGuard: CanActivateFn = () => { + const authService = inject(AuthService); + return authService.isAuthorized(); +}; -- GitLab