Skip to content

Commit 6d8e052

Browse files
authored
Merge pull request #937 from bcgov/feature/DSS-1154
DSS-1154 Primeng upgrade from 17 to 18+
2 parents 47947d5 + 2c56411 commit 6d8e052

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

frontend/src/app/app.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import { errorInterceptor } from './common/consts/error-interceptor.const';
1212
import { providePrimeNG } from 'primeng/config';
1313
import Aura from '@primeuix/themes/aura';
1414

15+
// Get the nonce value once and reuse it
16+
const cspNonce = document.querySelector('meta[name="csp-nonce"]')?.getAttribute('content') || undefined;
17+
1518
export const appConfig: ApplicationConfig = {
1619
providers: [
1720
provideAnimations(),
@@ -25,6 +28,9 @@ export const appConfig: ApplicationConfig = {
2528
darkModeSelector: false,
2629
cssLayer: false
2730
}
31+
},
32+
csp: {
33+
nonce: cspNonce
2834
}
2935
}),
3036
KeycloakService,
@@ -37,7 +43,7 @@ export const appConfig: ApplicationConfig = {
3743
MessageService,
3844
{
3945
provide: CSP_NONCE,
40-
useValue: document.querySelector('meta[name="csp-nonce"]')?.getAttribute('content'),
46+
useValue: cspNonce,
4147
},
4248
],
4349
}

0 commit comments

Comments
 (0)