test(portal-self-service): DigiD-guarded registration submit page (refs #67)
Scaffold libs/ui (NL Design System via Utrecht components) and libs/auth (DigiD OIDC over angular-auth-oidc-client: mockable AuthService, provider, token interceptor, authenticated guard). Failing component + axe tests for the RegistrationPage: it must show the signed-in BSN, submit to the BFF (mocked api-client) and confirm, with no WCAG 2.1 AA violations. The page is a stub, so the behaviour tests fail; green follows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
13
libs/auth/src/lib/authenticated.guard.ts
Normal file
13
libs/auth/src/lib/authenticated.guard.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user