siarashield_workspace 0.0.52 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -120,6 +120,8 @@ import { SiaraShieldComponent } from 'siarashield_workspace';
120
120
  })
121
121
  export class FormComponent {
122
122
  protected readonly environment = environment;
123
+ protected readonly cspNonce =
124
+ document.querySelector<HTMLMetaElement>('meta[name="csp-nonce"]')?.content ?? undefined;
123
125
 
124
126
  private isSubmitting = false;
125
127
  @ViewChild(SiaraShieldComponent) private readonly captcha?: SiaraShieldComponent;
@@ -150,6 +152,13 @@ If you already have a server-generated nonce available in code, you can still pa
150
152
  - Component input: `[cspNonce]="myNonce"`
151
153
  - Function API: `initSiaraShield({ ..., cspNonce: myNonce })`
152
154
 
155
+ Common Angular way to read it from the meta tag:
156
+
157
+ ```ts
158
+ protected readonly cspNonce =
159
+ document.querySelector<HTMLMetaElement>('meta[name="csp-nonce"]')?.content ?? undefined;
160
+ ```
161
+
153
162
  If omitted, the plugin auto-resolves the nonce from `meta[name="csp-nonce"]` or an existing `script[nonce]`.
154
163
 
155
164
  ## Function API (alternative)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siarashield_workspace",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "description": "Angular wrapper for CyberSiara SiaraShield captcha embed.",
5
5
  "schematics": "./schematics/collection.json",
6
6
  "ng-add": {