feat(portal-self-service): NL DS + DigiD self-service submit form (closes #67) #71
@@ -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,20 +24,25 @@ export interface DigiadAuthOptions {
|
|||||||
*/
|
*/
|
||||||
export function provideDigiadAuth(options: DigiadAuthOptions): EnvironmentProviders {
|
export function provideDigiadAuth(options: DigiadAuthOptions): EnvironmentProviders {
|
||||||
return makeEnvironmentProviders([
|
return makeEnvironmentProviders([
|
||||||
provideAuth({
|
provideAuth(
|
||||||
config: {
|
{
|
||||||
authority: options.authority,
|
config: {
|
||||||
redirectUrl: options.redirectUrl,
|
authority: options.authority,
|
||||||
postLogoutRedirectUri: options.redirectUrl,
|
redirectUrl: options.redirectUrl,
|
||||||
clientId: 'big-portal',
|
postLogoutRedirectUri: options.redirectUrl,
|
||||||
scope: 'openid profile',
|
clientId: 'big-portal',
|
||||||
responseType: 'code',
|
scope: 'openid profile',
|
||||||
silentRenew: true,
|
responseType: 'code',
|
||||||
useRefreshToken: true,
|
silentRenew: true,
|
||||||
secureRoutes: [options.secureApiOrigin],
|
useRefreshToken: true,
|
||||||
logLevel: LogLevel.Warn,
|
secureRoutes: [options.secureApiOrigin],
|
||||||
|
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 },
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user