File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ import { errorInterceptor } from './common/consts/error-interceptor.const';
12
12
import { providePrimeNG } from 'primeng/config' ;
13
13
import Aura from '@primeuix/themes/aura' ;
14
14
15
+ // Get the nonce value once and reuse it
16
+ const cspNonce = document . querySelector ( 'meta[name="csp-nonce"]' ) ?. getAttribute ( 'content' ) || undefined ;
17
+
15
18
export const appConfig : ApplicationConfig = {
16
19
providers : [
17
20
provideAnimations ( ) ,
@@ -25,6 +28,9 @@ export const appConfig: ApplicationConfig = {
25
28
darkModeSelector : false ,
26
29
cssLayer : false
27
30
}
31
+ } ,
32
+ csp : {
33
+ nonce : cspNonce
28
34
}
29
35
} ) ,
30
36
KeycloakService ,
@@ -37,7 +43,7 @@ export const appConfig: ApplicationConfig = {
37
43
MessageService ,
38
44
{
39
45
provide : CSP_NONCE ,
40
- useValue : document . querySelector ( 'meta[name="csp-nonce"]' ) ?. getAttribute ( 'content' ) ,
46
+ useValue : cspNonce ,
41
47
} ,
42
48
] ,
43
49
}
You can’t perform that action at this time.
0 commit comments