feat: implement authentication flow and dynamic API configuration #5

This commit is contained in:
Marek Lesko
2025-07-31 17:41:18 +02:00
parent 42f84e878f
commit 0ab0402172
14 changed files with 152 additions and 52 deletions

View File

@@ -0,0 +1,9 @@
import { CanActivateFn } from '@angular/router';
import { inject } from '@angular/core';
import { OAuthService } from 'angular-oauth2-oidc';
export const authGuard: CanActivateFn = (route, state) => {
const authService = inject(OAuthService);
return authService.hasValidAccessToken(); // returns boolean, Promise, or Observable
};