Compare commits

..

2 Commits

Author SHA1 Message Date
074101e836 fix(portal-self-service): run checkAuth() at startup to end the login redirect loop (refs #67)
All checks were successful
CI / lint (pull_request) Successful in 1m6s
CI / build (pull_request) Successful in 53s
CI / unit (pull_request) Successful in 1m3s
CI / frontend (pull_request) Successful in 1m56s
CI / mutation (pull_request) Successful in 3m55s
CI / verify-stack (pull_request) Successful in 4m34s
Without an app-init auth check, the DigiD callback (?code=…) was never processed, so
the guard kept seeing 'not authenticated' and re-triggered login — an infinite
redirect loop. Add withAppInitializerAuthCheck() so checkAuth() runs before the router
and guard, establishing the session on the callback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 13:26:42 +02:00
5089c2aea6 fix(portal-self-service): re-export the full Utrecht package from libs/ui (refs #67)
Some checks failed
CI / lint (pull_request) Successful in 1m5s
CI / build (pull_request) Successful in 51s
CI / unit (pull_request) Successful in 59s
CI / frontend (pull_request) Successful in 1m30s
CI / mutation (pull_request) Successful in 3m54s
CI / verify-stack (pull_request) Has been cancelled
Importing UtrechtComponentsModule pulls every component it exports into the AOT
compiler scope, so all must be resolvable through the ui barrel; a partial
re-export failed a fresh build with NG3004 (masked locally by the Nx build cache,
surfaced by nx serve / a --skip-nx-cache build). Re-export the whole package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 13:23:17 +02:00
2 changed files with 28 additions and 24 deletions

View File

@@ -1,5 +1,10 @@
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';
import { authInterceptor, LogLevel, provideAuth } from 'angular-auth-oidc-client'; import {
authInterceptor,
LogLevel,
provideAuth,
withAppInitializerAuthCheck,
} from 'angular-auth-oidc-client';
import { AuthService } from './auth.service'; import { AuthService } from './auth.service';
import { DigiadAuthService } from './digid-auth.service'; import { DigiadAuthService } from './digid-auth.service';
@@ -19,7 +24,8 @@ export interface DigiadAuthOptions {
*/ */
export function provideDigiadAuth(options: DigiadAuthOptions): EnvironmentProviders { export function provideDigiadAuth(options: DigiadAuthOptions): EnvironmentProviders {
return makeEnvironmentProviders([ return makeEnvironmentProviders([
provideAuth({ provideAuth(
{
config: { config: {
authority: options.authority, authority: options.authority,
redirectUrl: options.redirectUrl, redirectUrl: options.redirectUrl,
@@ -32,7 +38,11 @@ export function provideDigiadAuth(options: DigiadAuthOptions): EnvironmentProvid
secureRoutes: [options.secureApiOrigin], secureRoutes: [options.secureApiOrigin],
logLevel: LogLevel.Warn, logLevel: LogLevel.Warn,
}, },
}), },
// Run checkAuth() at startup so the DigiD callback (?code=…) is processed before the router
// and guard run — without it the guard sees "not authenticated" and re-triggers login (loop).
withAppInitializerAuthCheck(),
),
{ provide: AuthService, useClass: DigiadAuthService }, { provide: AuthService, useClass: DigiadAuthService },
]); ]);
} }

View File

@@ -5,13 +5,7 @@
// The Utrecht v3 components are NgModule-based (not standalone), so we re-export the module. // The Utrecht v3 components are NgModule-based (not standalone), so we re-export the module.
// A standalone component consumes them by importing UtrechtComponentsModule in its `imports` // A standalone component consumes them by importing UtrechtComponentsModule in its `imports`
// (CLAUDE.md §10 forbids *declaring* NgModules in our code, not consuming a third-party one). // (CLAUDE.md §10 forbids *declaring* NgModules in our code, not consuming a third-party one).
// The component classes are re-exported too so the AOT compiler can resolve the template // Re-export the whole Utrecht package: importing UtrechtComponentsModule pulls every component it
// directives (utrecht-article, utrecht-button, …) through this barrel. // exports into the compiler's scope, so the AOT build needs all of them resolvable through this
export { // barrel (a partial re-export fails with NG3004 for the first unused component).
UtrechtArticle, export * from '@utrecht/component-library-angular';
UtrechtButtonAttr,
UtrechtComponentsModule,
UtrechtDocument,
UtrechtHeading1,
UtrechtParagraph,
} from '@utrecht/component-library-angular';