import { inject } from '@angular/core'; import { CanActivateFn } from '@angular/router'; import { AuthService } from './auth.service'; /** Allow the route only when a DigiD session is active; otherwise start the login. */ export const authenticatedGuard: CanActivateFn = () => { const auth = inject(AuthService); if (auth.isAuthenticated()) { return true; } auth.login(); return false; };