Skip to content

Commit

Permalink
Refactor: web perf - load recaptcha script only where it's needed (#2631
Browse files Browse the repository at this point in the history
)
  • Loading branch information
angela-tran authored Jan 17, 2025
2 parents 82b4b67 + 26ccf3c commit afc03f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions benefits/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,5 @@
});
});
</script>

{% if request.recaptcha %}
<script nonce="{{ request.csp_nonce }}" src="{{ request.recaptcha.script_api }}"></script>
{% endif %}
</body>
</html>
2 changes: 2 additions & 0 deletions benefits/core/templates/core/includes/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
</script>

{% if request.recaptcha %}
<script nonce="{{ request.csp_nonce }}" src="{{ request.recaptcha.script_api }}"></script>

{% comment %}
Adapted from https://stackoverflow.com/a/63290578/453168
{% endcomment %}
Expand Down

0 comments on commit afc03f0

Please sign in to comment.