DethAriel / ng-recaptcha

Angular component for Google reCAPTCHA
https://dethariel.github.io/ng-recaptcha/
MIT License
463 stars 122 forks source link

fixes bug where recaptcha/api.js could not access CSP nonce #301

Closed pedroqueiroga closed 11 months ago

pedroqueiroga commented 11 months ago

https://google.com/recaptcha/api.js figures out the CSP nonce to use by checking a nonce attribute: d.querySelector('script[nonce]'). That does not work because this lib sets the nonce using script.nonce = nonce. This patch sets the nonce attribute instead, making ng-recatpcha's RECAPTCHA_NONCE more useful.

DethAriel commented 11 months ago

Thx @pedroqueiroga , I didn't realize that was the case, so good catch!